Jump to content
  • Advertisement
Sign in to follow this  
Joshnathan

bool...

This topic is 5082 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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);

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!