Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Vectors in classes?

Author
Message
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 18th Jul 2009 20:34
I've learned a bit about classes and vectors recently. so I've tried putting 'em together. Here's the error-full code I came up with:


I'm sure that this is all because of me improperly declaring the vector arrays, but I'm not sure how to correct this. Would I have to declare the vector arrays in the constructor? I'm pretty lost here, and I haven't been able to find much searching the web. Any help?

Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 18th Jul 2009 20:55 Edited at: 18th Jul 2009 20:55
Here this compiles:



Your_Health = (My_Mood == HAPPY) ? 100 : NULL;
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 18th Jul 2009 21:06
cool, thanks.

So... if i were to define a function in the private part of a class, then what would that make it? Would it only be accessable through functions in the public part of that class?
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 18th Jul 2009 21:09 Edited at: 18th Jul 2009 21:11
Anything declared as private in a class can only be accessible by the member functions (private or public) of that class.

Pretty much everything about classes can be learned here: http://www.cplusplus.com/doc/tutorial/classes/ and http://www.cplusplus.com/doc/tutorial/classes2/

Your_Health = (My_Mood == HAPPY) ? 100 : NULL;

Login to post a reply

Server time is: 2024-10-01 08:26:49
Your offset time is: 2024-10-01 08:26:49