3
Reply

Memory Management in C# for a class members

Prashant Choubey

Prashant Choubey

Jul 8 2015 1:05 PM
427
Could you please explain where the memory would be allocated for each of the members listed below if I create an Instance of the following class 'clsTest'. If you could let me know any way using Visual studio to identify the memory allocation would be great.
 
 intVal 
 strVal
 strValueStatic
 doSomething
 x
 y
 funIntVal
 funStrVal
 
class clsTest
{
int intVal;
string strVal;
static string strValueStatic;
public void doSomething(int x, string y)
{
      int funIntVal = x;
      string funStrVal = y ;
      Console.WriteLine("output : {0}, {1)", funIntVal.ToString() , funStrVal);
}
Thanks in advance!

Answers (3)