Answer the question
In order to leave comments, you need to log in
What does an uninitialized variable store in C#?
What does an uninitialized variable store in C#?
As far as I know, in C ++ such variables store any "garbage", in Java null, and for C # I did not find any information other than "give an error".
Answer the question
In order to leave comments, you need to log in
if the variable is declared, but not YET initialized - there will be a default value (null for classes, a specific value for structures (see default)). You can check it directly in the debugger.
will refer to a variable that is OBVIOUSLY not initialized at the moment of access (just the situation when there is some rubbish in it in c ++) - it is impossible, because this is considered a potential bug and such code will not even compile. (I suspect that the question was once about this part)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question