#include class myClass // How to define a "class" type { // This is NOT a variable definition public: int i; // It serves to tell C++ what "myClass" looks like float f; }; myClass x; // How to define class variables int main(int argc, char *argv[]) { myClass A[3]; // How to define arrays of class variables extern myClass x; // How to DECLARE class variables void Print(myClass *); // Pass a reference (address) by VALUE x.i = 1234; // How to use a struct variable x.f = 3.14; Print(&x); Print(&x); } /* -------------------------------------------------- How to pass address to class variables by VALUE -------------------------------------------------- */ void Print(myClass *h) { cout << "Structure values (using (*))= (" << (*h).i << ", " << (*h).f << ")\n"; cout << "Structure values (using ->) = (" << h->i << ", " << h->f << ")\n\n"; h->i = h->i + 1000; h->f = h->f + 1000; }