Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What are BOOL and UNIT? 1

Status
Not open for further replies.

MikeCox

Programmer
Jun 4, 2001
340
US
Hi!

I know BOOL can be either TRUE or FALSE, just like the built-in bool data type, but what is the difference between the two? MFC AppWizard doesn't seem to use bool at all, favoring BOOL instead. I assume it's some sort of class or struct, but what functionality does it provide besides the basic TRUE/FALSE values? Also, I don't know the first thing about UNIT, but I see it used extensively as well. Another class? Encapsulating what kind of stuff for what purpose? MSDN's definitions of UNIT and BOOL seem to be hiding from me.

Thank you!

~Mike
Any man willing to sacrifice liberty for security deserves neither liberty nor security.

-Ben Franklin
 
UINT is unsigned integer.

The difference between BOOL and bool is... well, I'm not really sure typewise, but BOOL is MS's implementation that's been around for quite some time and bool is the ANSI C implementation that hasn't been around quite as long. Since there is no such animal as a bit-length variable, I use unsigned char myself.

If you compile your program to include browse information, you can right-click something and choose "go to definition" to find out how something's defined. Even works on MS stuff (if you have the source files installed).

---Evil Peer
 
Well good, maybe now that I know what UINT stands for I'll quit calling it a 'UNIT', eh? : ) And it sounds like BOOL is a lot like CString, where C++ didn't have a string data type until recently, but by then MS had created their own string class to handle it. I'll definately be digging around in these definitions now, I didn't realize you could trace into the code outside your project with the definition menu.

Thanks a lot!

~Mike
Any man willing to sacrifice liberty for security deserves neither liberty nor security.

-Ben Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top