Valhalla Legends Forums Archive | C/C++ Programming | Classes

AuthorMessageTime
MoNksBaNe_Agahnim
Hey hey,

I may get flamed but oh well. I have been studing classes for a couple of days now and am wondering what a good project, not necessarly one as big as a bot, to practice with, my teacher doesn't know crap about C++ and all the tutorials I have used don't give you an excercise. So what is a good program to mess around with to better understand classes.

**Note** I haven't gotten much into inheratence or any of Polymorphism.

Thanks for help ^^
January 3, 2004, 5:49 AM
iago
Well, if you don't mind Java code, I can show you examples of inheritance/polymorphism fairly easily (try http://www.valhallalegends.com/iago/JavaBot.rar, I think that's the right link). That one uses polymorphism to process events. It's basically done the same way in C++ *except* you have to declare the function as virtual, so instead of this java:
[code]public class moo
{
public boolean iagorox() { return true; }
}[/code]

you'd have this equivolant c++:
[code]
class moo
{
public:
virtual bool iagorox() { return true; }
}[/code]

but take a look at that code, see if you can tell what's happening. You don't even have to run it, but if you want to anyway get java+netbeans from java.sun.com.
January 3, 2004, 1:15 PM
MoNksBaNe_Agahnim
thanks bro :)
January 3, 2004, 8:09 PM

Search