Click here to Skip to main content
15,908,673 members

Comments by cooljeba1 (Top 6 by date)

cooljeba1 4-Jan-11 7:59am View    
lol..

anyways.. thanks for your help.. I appriciate it..
cooljeba1 4-Jan-11 1:52am View    
Hi,

Thanks for your comments.. but yesterday I found another link please refer http://en.csharp-online.net/Value_vs_Reference
Here it shows that the address of the reference type is also stored in the stack.. only the reference type data is stored in heap ?
cooljeba1 3-Jan-11 8:56am View    
Deleted
Thanks for explaing that.. hmm this what I understand now (please correct me if I am wrong)


class c
{
public int a = 10;
}


c obj = new c();
when we create an instance the value of "a" is stored in the stack

but when we update the value
obj.a = 11;

now obj.a contains the address of "a" in the stack or obj.a will directly hold the value 11 in heap ?
cooljeba1 3-Jan-11 8:40am View    
Thanks for explaing that.. hmm this what I understand now (please correct me if I am wrong)
class c
{
public int a = 10;
}


c obj = new c();
when we create an instance the value (10) of "a" is stored in the stack

but when we update the value
obj.a = 11;

now obj.a contains the address of "a" in the stack or obj.a will directly hold the value 11 in heap ?
cooljeba1 3-Jan-11 7:31am View    
Yes I tried that.. a.GetType().tostring() displays the type as Int32 which is a value type.. But my doubt was how are they tied together.. I mean the heap and the stack ?

Thanks