To see how structs are used and declared download the attached file to /tmp rename it and set the execute bit, then run it like so
Code:
cd /tmp
mv CScript.cc.txt CScript.cc
chmod +x CScript.cc
./CScript.cc
You should get this:
Code:
Data pointed to by rq: x (int) = 666, y ( const char*) Hello world
Data in static structure staticsrqtruct: x (int) = 999, y ( const char*) Goodbye world
Notice the structure is only declared once but two instances are created.