Click here to Skip to main content
15,907,687 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
1.Why are the initial value of static variable and global variable is zero
Posted
Comments
nv3 8-Jul-13 10:28am    
Better zero than anything else. And better zero than undefined. This is basically a feature that most linkers offer. Hence it was introduced into the language definition.
Hemant Singh Rautela 8-Jul-13 10:34am    
You can initialize it any default value... Whats the problem..???
Sergey Alexandrovich Kryukov 8-Jul-13 10:55am    
Why #1. An interview/test question, or something like that?
—SA
nv3 8-Jul-13 11:09am    
You are probably right, Sergey.
bbirajdar 8-Jul-13 11:11am    
Zero looks better than 007...

1 solution

 
Share this answer
 
Comments
Maciej Los 8-Jul-13 12:31pm    
Good link ;)
+5
pasztorpisti 8-Jul-13 12:34pm    
Thank you! :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900