Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple C# doubt...

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,
I have read from Tom Archer's Inside C# book, saying that data type int is a alias name created by c# for the class System.Int32. If so int should be reference type. But they are saying that it is a value type and when we declare int it will be stored in stack only. I could not get the correct difference...Could any one please help me out in this question...

Thanks in advance,
leslie
 
The book is almost correct. int is a reference for the System.Int32 struct not class. A struct is a value type and a class is a referense type.

Hope this clear things up, Larsson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top