#include // declaration and definition static int w; struct tester { int x; static int y; static int z; }; // definition int tester::z = 3; int main(int argc, char** argv) { // 4 bytes, no allocation for the static var std::cout << "sizeof tester " << sizeof(tester) << std::endl; // this will not compile. // y has been declared but not defined // std::cout << "tester::y = " << tester::y << std::endl; std::cout << "tester::z = " << tester::z << std::endl; std::cout << "w = " << w << std::endl; return 0; }