Please help! Can someone tells me how to declare a globle variable in Main()? I really appreciate!
Please help! Can someone tells me how to declare a globle variable in Main()? I really appreciate!
A global variable is a variable which is defined outside all functions. Hope the example explains:
A variable declared in a function is only known by that function and therefore called local.Code:#include <stdio.h> int global_var = 5; int main () { printf ("Global variable global_var has value %d\n", global_var); return 0; }
Thank you Shiro. I got it.