You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Global variables are the variables that has global scope all over the program and can be accessed by any function, class or scope. But we must avoid using global variables in many cases because through reassigning, its value can be easily changed.
//Global variables are defined above or outside the scope of int main();
a();//calling a function
b();//calling b function
cout<<"Global variable in main: "<<global<<endl;
{
cout<<"Global variable in undefined scope: "<<global<<endl;