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

.NET (Core and Framework)

 
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 
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 
I am sorry my answer:
"Yes, an integer will only take 4 bytes."

could leave you in doubt how much memory an integer takes, though I have no idea what so ever how it could be written clearer. And no, my explanation does obviously not imply that more data is stored than the 4 bytes.

I do not know what you mean with "more information available" - yes, obviously it has. Every single object ever created has more information available than the bytes it takes up in memory (as it can easily access the information for the class itself). Or maybe you are referring to the information built into the CLR allowing it to do the boxing/unboxing - sure there is information available for that as well, but obviously per class, not per object, so it does not affect the amount of bytes each object use.


With regards to:
int a=12; // is not a ValueType until
string s = a.ToString() // is called

it probably goes on details in the CLR. "a" is not boxed before the a.ToString call, but at any time "a is ValueType" would return true, and at any time it can be used as a ValueTime. Hence I would consider it a ValueType no matter how it happens to be represented in memory, but I can see the other side of the argument as well - it all comes down to seeing it from the level of C# or from the level of the CLR implementation.
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 
QuestionVisual C++ with .NET Framework Pin
prithaa15-Oct-07 23:31
prithaa15-Oct-07 23:31 
AnswerRe: Visual C++ with .NET Framework Pin
Pete O'Hanlon16-Oct-07 2:15
mvePete O'Hanlon16-Oct-07 2:15 
AnswerRe: Visual C++ with .NET Framework Pin
rtalan17-Oct-07 0:25
rtalan17-Oct-07 0:25 

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.