title: How to convert fieldinfo to it's actual class object? using C#
body: <p>i need to create program that navigate an object structure and print the structure of any “struct” provided as an argument.</p>
  
  <p>These "structs" are defined as follows:</p>
  
  <ul>
  <li>They have only public attributes  </li>
  <li>Each attribute can be of the following types:  
  
  <ul>
  <li>“Structs”  </li>
  <li>Primitive (e.g. int), primitive wrapper (e.g. Integer) or String</li>
  </ul></li>
  </ul>
  
  <p>the problem is when i'm trying to print data member which is a class or struct.
  i'm trying to to write a recursive function that gets an object and check each field in the object: if it's a class them i send again the curr field to the same function. 
  else i print the value of the field.</p>
  
  <p>this is my code. but when i send the fieldInfo to the function the code line:
  ---> <code>Type objType = i_obj.GetType();</code></p>
  
  <p><strong>is getting me the next value:</strong> 
  <code>object.GetType</code> returned   <code>{Name = "RtFieldInfo" FullName = System.Reflection.RtFieldInfo"}   System.RuntimeType</code></p>
  
  <pre><code>    public static void getObj(object i_obj)
      {
          Type objType = i_obj.GetType();
  
          FieldInfo[] objField = objType.GetFields();
  
          foreach (FieldInfo member in objField)
          {
              Type memberType = member.FieldType;
  
              if(memberType.IsClass)
              {                    
                  getObj(member);
              }
  
              else
              {
                  Console.WriteLine(member.Name + " : " + member.GetValue(i_obj));
              }
  
          }
      }
  </code></pre>
  
  <p>how can i get the real object from fieldInfo ?? </p>