Results 21 to 22 of 22
Thread: It's Alive!
- 07-31-2010, 03: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, 12:02 AM #22
Senior Member
- Join Date
- Mar 2009
- Posts
- 552
- Rep Power
- 5
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!
Similar Threads
-
Keep my TCP connection alive
By eggmanpete in forum Advanced JavaReplies: 4Last Post: 03-02-2009, 06:11 AM -
How to configure "keep alive" in Sockets?
By rajdotme in forum NetworkingReplies: 1Last Post: 04-16-2008, 11:36 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks