bool...

Started by
4 comments, last by Joshnathan 19 years, 6 months ago
Ok, this can sound very n00by, but it is the "beginner" foruma after all :) I followed a set of tutorials on gametutorials.com and now I have an example source code which contains a function defined as bool. I have never seen this yet, can anyone explain me what it means? ex out of tutorial maze1 gametutorials.com: bool MovePlayer(CHAR_INFO screenBuffer[], COORD &playerPos);
-----------------------------Sismondi GamesStarted c++ in October 2004...
Advertisement
A bool is a variable which can take two values true and false. It's useful in many circumstances and in your case I'd guess that function would return true if it succeeds (i.e. it moves the player) or false if it didn't (i.e. it didn't move the player).
thank you very much, one other question. What does the CHAR_INFO do?
in the same tutorial(maze1) I have the line:
CHAR_INFO screenBuffer[SCREEN_WIDTH * SCREEN_HEIGHT] = {0};

I know the tutorial covers it somewhere, but can anyone explain me or is it too long?
-----------------------------Sismondi GamesStarted c++ in October 2004...
just so you know, msdn contains many c++ definitions. in this case the CHAR_INFO structure defines a single cell of the console, which has attributes such as the forecolor, backcolor, whether it is filled with a character, ect.
- stormrunner
CHAR_INFO is either a macro or an enumeration. Check in the header files or at the top of the source file to see exactly what it is. If you see #define CHAR_INFO <x> then it's a macro. If you see something like enum CHAR_INFO {x, y, z}; then it's an enumeration.

EDIT: Nevermind. Just read the above posters. Apparently he got the post up while I was typing mine.
hehe, thanks guys that helped me out :)
-----------------------------Sismondi GamesStarted c++ in October 2004...

This topic is closed to new replies.

Advertisement