#include <iostream>
usingnamespace std;
struct abc
{
staticint x;
};
//int abc::x;
int main()
{
abc obj1;
obj1.x = 10;
cout << "Value of 10 = " << obj1.x << endl;
return 0;
}
This code produces error.
undefined reference to X.
But If I uncomment line above int main() then this code works.