Re: Value type intialization...

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Nope; it must be assigned; what you have is comparable to:

int a;
a.ToString();

which fails for the same reason; you /must/ give it a starting value, even
if it is just "new MyStruct();"

Marc


.



Relevant Pages

  • Re: what is wrong?
    ... The only reason you "should" get no output is if the int 21h/47h fails. ... After the "xlatb", ...
    (alt.lang.asm)
  • Re: Creating generic Isolator class for collection modidy inside foreach loop
    ... Marc has provided the reason why this fails, and a fix - but if you're ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Prime Numbers
    ... struct node *next; ... int main ... which testcase it fails which value of i it fails. ... One reason could be ...
    (comp.lang.c)
  • Re: K&R2 1.6 Arrays, exercise 1-13 (vertical histogram)
    ... | int main ... I thought you always initialised variables on declaration, ... This, of course, could have been done by initialising on declaration ... (If the latter reason is true, learning it would have done no good here, because Reason 1 would still have applied.) ...
    (comp.lang.c)
  • Re: make a program that count lines in a text
    ... int strlen(); // in strings.h but save time reading whole header ... If you are expecting a text file, open it with "r" on Windows, Linux ... The above test fails to detect empty lines-. ...
    (comp.lang.c)