Structures can have functions similar to classes. The only difference is that they are publicly available by default:
struct A { void f() {} };
In addition, structures can also have constructors and destructors.
struct A { A() : x(5) {} ~A() {} private: int x; };
0x499602D2 Oct 29 '12 at 16:46 2012-10-29 16:46
source share