View Single Post
Old May 4th, 2008, 9:31 PM   #13
peaceofpi
hi: for(;;) goto hi;
 
peaceofpi's Avatar
 
Join Date: Jun 2006
Posts: 86
Rep Power: 3 peaceofpi is on a distinguished road
Send a message via AIM to peaceofpi Send a message via MSN to peaceofpi
Re: Simple if statement question :(

Quote:
Originally Posted by Arnack View Post
Hey, cool! Thanks a lot, that was very helpful. I couldn't help but catch the "bool" an and then the variable bCont after it.
What exactly is bool? I thought I would use "string" for that, simply because I was holding text characters in it.

I'm also creating a small text based role playing game in C++ as for a a bit of practice. Will it be a problem posting the source in this thread as well?
bool is short for the boolean type which holds either a true or false value. bCont is always true unless the user fails to enter "Y" (or "y") in which case the loop stops.

As for the function problem: in maingame() you've put stats() in as a prototype and not a regular call. Take out the void part and it'll work. I love abusing this icode tag.

I highly recommend you tackle some more learning materials for C++ before starting something like an RPG. Since this is C++, I'll tell you now before someone else does that you probably want to learn about classes. Also you should consider a code-oriented text editor; your wacky spacing (no offense) will probably become the source of some issues that are hard to solve.
__________________
How do you play Religious Roulette?
Stand around in a circle and blaspheme till someone gets struck by lightning.
peaceofpi is offline   Reply With Quote