title: Object pointers(object*) in C#
body: <p>What I want to do is, I want to pass a pointer to a function that may be any type of a variable(int, long, string, even a class I mean I should be able to pass any variable's pointer). I'm doing this like that</p>
  
  <pre><code>unsafe class whatever
  {
      whatever(object* variable)
      {
            this.variable = variable;
      }
  }
  </code></pre>
  
  <p>ERROR IS: Cannot take the address of, get the size of, or declare a pointer to a managed type ('object')</p>
  
  <p>Why I want to do is, I will store the variables passed through the constructor and will use their ToString() method, I'm trying to make a class that is for console applications, Refreshing the variables with their updated variables. </p>
  
  <p>If I could do it like that My code will look like that</p>
  
  <pre><code>unsafe class whatever
  {
      whatever(object* variable)
      {
          this.variable = variable;
      }
  
      object* variable;
  
      public override string ToString()
      {
          return *variable.ToString();
      }
  }
  </code></pre>