I have a .cc file with several methods in it. I also have some structs declared at the top of the file that I use inside of the .cc file. I'd like these structs to have methods, ie. I'd like the structs to be classes. Is that only a matter of replacing the word struct with class?
Currently I have:
I'd like to have:Code:struct A { int a1; int a2; }
Is that all I have to do?Code:class A { int a1; int a2; int add(void) { return a1+a2; } }