Results 21 to 22 of 22
Thread: It's Alive!
- 07-31-2010, 04:19 AM #21
It's funny; when doing C/C++, I use structs for classes that store more data (and are mostly get/set methods) than have functions. Classes are used for more objects that have methods outside of get and set. Interesting differences from different programmers; the lesson here is that there is no one way to program!
- 08-01-2010, 01:02 AM #22Senior Member
- Join Date
- Mar 2009
- Rep Power
That's what I was saying. Probably just a leftover from C, where structs could only hold data and function pointers (which are weird).
Reread my post, and noticed it needs clarification. With JAVA, I would have a prepareBuild method in a Resources class. With C++, it'd be in the city class, because resources would be a struct and wouldn't have methods (usually just a constructor and a few operators in structs for me).If the above doesn't make sense to you, ignore it, but remember it - might be useful!
And if you just randomly taught yourself to program, well... you're just like me!