Declaration of variable without initialization
Why does the declaration "int i;" generates value of i as 0 in languages like Java and C# but displays garbage values in C and C++. Also, when we declare i outside main in C or declare it as static outside class it shows value 0. Why is it so?
|