Click here to Skip to main content
15,917,808 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionValueType vs Reference Pin
rtalan17-Oct-07 0:16
rtalan17-Oct-07 0:16 
AnswerRe: ValueType vs Reference Pin
Robert Rohde17-Oct-07 0:27
Robert Rohde17-Oct-07 0:27 
GeneralRe: ValueType vs Reference Pin
rtalan17-Oct-07 0:48
rtalan17-Oct-07 0:48 
GeneralRe: ValueType vs Reference Pin
lmoelleb17-Oct-07 1:39
lmoelleb17-Oct-07 1:39 
GeneralRe: ValueType vs Reference Pin
rtalan17-Oct-07 1:53
rtalan17-Oct-07 1:53 
GeneralRe: ValueType vs Reference Pin
lmoelleb17-Oct-07 2:12
lmoelleb17-Oct-07 2:12 
GeneralRe: ValueType vs Reference Pin
rtalan17-Oct-07 2:42
rtalan17-Oct-07 2:42 
GeneralRe: ValueType vs Reference Pin
Luc Pattyn17-Oct-07 2:57
sitebuilderLuc Pattyn17-Oct-07 2:57 
Yes an instance of System.Int32 occupies exactly 4 bytes in memory when it is allocated on the stack.

Yes an instance of System.Int32 is also a System.Object and if the CLR needs its object
behavior, the compiler will have provided the necessary code to make it act as an object,
but that does not change the data foot print.

Example:
int a=12;
string s=a.ToString();

the ToString() method applies to "object" a, the compiler will allocate a 4B integer on stack
and generate code that calls System.Int32.ToString().

Smile | :)


Luc Pattyn [Forum Guidelines] [My Articles]


this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google


GeneralRe: ValueType vs Reference Pin
rtalan17-Oct-07 3:31
rtalan17-Oct-07 3:31 
GeneralRe: ValueType vs Reference Pin
Luc Pattyn17-Oct-07 3:44
sitebuilderLuc Pattyn17-Oct-07 3:44 
GeneralRe: ValueType vs Reference Pin
lmoelleb17-Oct-07 4:46
lmoelleb17-Oct-07 4:46 
GeneralRe: ValueType vs Reference Pin
George L. Jackson17-Oct-07 12:24
George L. Jackson17-Oct-07 12:24 
GeneralRe: ValueType vs Reference Pin
DavidNohejl17-Oct-07 23:21
DavidNohejl17-Oct-07 23:21 
Questionhow to use Indesign files in asp.net Pin
gopal_Pandey16-Oct-07 18:56
gopal_Pandey16-Oct-07 18:56 
AnswerRe: how to use Indesign files in asp.net Pin
Pete O'Hanlon16-Oct-07 23:48
mvePete O'Hanlon16-Oct-07 23:48 
AnswerRe: how to use Indesign files in asp.net Pin
Pete O'Hanlon18-Oct-07 22:06
mvePete O'Hanlon18-Oct-07 22:06 
GeneralRe: how to use Indesign files in asp.net Pin
gopal_Pandey24-Oct-07 0:33
gopal_Pandey24-Oct-07 0:33 
QuestionExtracting .zip files Pin
Vipul Mehta16-Oct-07 6:25
Vipul Mehta16-Oct-07 6:25 
AnswerRe: Extracting .zip files Pin
Giorgi Dalakishvili16-Oct-07 6:49
mentorGiorgi Dalakishvili16-Oct-07 6:49 
GeneralRe: Extracting .zip files Pin
Vipul Mehta16-Oct-07 18:27
Vipul Mehta16-Oct-07 18:27 
AnswerRe: Extracting .zip files Pin
Shahar Gvirtz16-Oct-07 8:44
Shahar Gvirtz16-Oct-07 8:44 
AnswerRe: Extracting .zip files Pin
Vipul Mehta16-Oct-07 18:33
Vipul Mehta16-Oct-07 18:33 
AnswerRe: Extracting .zip files Pin
rtalan17-Oct-07 1:20
rtalan17-Oct-07 1:20 
GeneralRe: Extracting .zip files Pin
Vipul Mehta17-Oct-07 20:28
Vipul Mehta17-Oct-07 20:28 
AnswerRe: Extracting .zip files Pin
Mike Dimmick17-Oct-07 2:53
Mike Dimmick17-Oct-07 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.