#include<iostream.h>
int a;
class g{
cout<<a;
};
int main()
{
cout<<a;
return 0;
}
Why am I not able to print the global variable a
inside of the class, but at same time, I am able to print a
inside main
? Is there no way to use cout
in a class?