Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
QuestionTFS Workitem type task Save failed. Pin
Member 1067824227-May-15 3:12
Member 1067824227-May-15 3:12 
AnswerRe: TFS Workitem type task Save failed. Pin
Dave Kreskowiak27-May-15 3:58
mveDave Kreskowiak27-May-15 3:58 
GeneralRe: TFS Workitem type task Save failed. Pin
Member 1067824227-May-15 18:41
Member 1067824227-May-15 18:41 
GeneralRe: TFS Workitem type task Save failed. Pin
Dave Kreskowiak28-May-15 1:22
mveDave Kreskowiak28-May-15 1:22 
QuestionHow to calculate Size of a variable at runtime ? Not the datatype size. Pin
Gyana_Ranjan Dash26-May-15 21:14
Gyana_Ranjan Dash26-May-15 21:14 
AnswerRe: How to calculate Size of a variable at runtime ? Not the datatype size. Pin
Richard MacCutchan26-May-15 21:51
mveRichard MacCutchan26-May-15 21:51 
AnswerRe: How to calculate Size of a variable at runtime ? Not the datatype size. Pin
Simon_Whale26-May-15 22:01
Simon_Whale26-May-15 22:01 
AnswerRe: How to calculate Size of a variable at runtime ? Not the datatype size. Pin
OriginalGriff26-May-15 23:49
mveOriginalGriff26-May-15 23:49 
The size of a variable is the size of the type it declared as: so for your example:
C#
int anyValue = 10;
the size of anyValue is always 32bits / 4 bytes because an int is a fixed size, regardless of what it contains.

This is even true for reference types: the variable which holds the reference will always be the same size:
C#
Control c = button1;
c is a reverence to a Control instance, so it will always be 32 bits or 64 bits depending on your your app is built and running.
The value it refers to can be different sizes in some cases: string, arrays, collections and so on can be variable sized1, but in general even a specific instance of a class will always be the same size. Value type instances are always the same size, they can't vary.

1: Even then, the collection instance is not a variable size, but the data it collects may be - the actual collection of objects is stored as an array of objects which is itself a reference.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: How to calculate Size of a variable at runtime ? Not the datatype size. Pin
Gyana_Ranjan Dash27-May-15 1:10
Gyana_Ranjan Dash27-May-15 1:10 
GeneralRe: How to calculate Size of a variable at runtime ? Not the datatype size. Pin
Richard Deeming27-May-15 1:20
mveRichard Deeming27-May-15 1:20 
GeneralRe: How to calculate Size of a variable at runtime ? Not the datatype size. Pin
OriginalGriff27-May-15 1:23
mveOriginalGriff27-May-15 1:23 
GeneralRe: How to calculate Size of a variable at runtime ? Not the datatype size. Pin
Gyana_Ranjan Dash27-May-15 19:59
Gyana_Ranjan Dash27-May-15 19:59 
GeneralRe: How to calculate Size of a variable at runtime ? Not the datatype size. Pin
harold aptroot27-May-15 2:58
harold aptroot27-May-15 2:58 
Questionwhy no edit-flag at design-time, no compile-time error on this code abomination ? Pin
BillWoodruff26-May-15 10:48
professionalBillWoodruff26-May-15 10:48 
AnswerRe: why no edit-flag at design-time, no compile-time error on this code abomination ? Pin
Sascha Lefèvre26-May-15 11:17
professionalSascha Lefèvre26-May-15 11:17 
QuestionC# -> PHP/MYSQL Pin
Zell Kennedy26-May-15 4:02
Zell Kennedy26-May-15 4:02 
AnswerRe: C# -> PHP/MYSQL Pin
Bernhard Hiller26-May-15 6:36
Bernhard Hiller26-May-15 6:36 
GeneralRe: C# -> PHP/MYSQL Pin
Zell Kennedy26-May-15 7:30
Zell Kennedy26-May-15 7:30 
QuestionProblem Faced when perform row grouping in excel using c# Pin
Member 1130300726-May-15 2:18
Member 1130300726-May-15 2:18 
QuestionDifference Between Equality Operator ( ==) and .Equals() Method in C# Pin
Gyana_Ranjan Dash25-May-15 20:26
Gyana_Ranjan Dash25-May-15 20:26 
AnswerRe: Difference Between Equality Operator ( ==) and .Equals() Method in C# Pin
OriginalGriff25-May-15 20:46
mveOriginalGriff25-May-15 20:46 
GeneralRe: Difference Between Equality Operator ( ==) and .Equals() Method in C# Pin
Agent__00725-May-15 22:43
professionalAgent__00725-May-15 22:43 
GeneralRe: Difference Between Equality Operator ( ==) and .Equals() Method in C# Pin
Alan N25-May-15 23:22
Alan N25-May-15 23:22 
GeneralRe: Difference Between Equality Operator ( ==) and .Equals() Method in C# Pin
Agent__00725-May-15 23:56
professionalAgent__00725-May-15 23:56 
GeneralRe: Difference Between Equality Operator ( ==) and .Equals() Method in C# Pin
Gyana_Ranjan Dash26-May-15 21:08
Gyana_Ranjan Dash26-May-15 21:08 

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.