Hacker News new | past | comments | ask | show | jobs | submit login
What does it mean to initialize an int? (herbsutter.com)
2 points by ingve 40 days ago | hide | past | favorite | 1 comment



Unless it flashed past me, I didn't see any mention of the ubiquitous

     int a=5;
style of initialisation.

I tend to initialise all ints as a zero default with "int xxx = 0;". I know that all globals, etc are initialised to zero anyway by the compiler, but 'belt and braces' kind of habit. That way I don't get weird and wonderful things occurring because my int variable is actually initially -3281932 instead of 0.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: