Archived

This topic is now archived and is closed to further replies.

Microsoft Specific Data Types

This topic is 5697 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

I know bool isn''t the same as BOOL, but what is the difference?

bool uses true and false
whereas
BOOL uses TRUE and FALSE

but in essence they have the same function right? If you use BOOL, you don''t need bool so which is better to use and what difference is there?

Share this post


Link to post
Share on other sites
least helpful posts ever. at least say STFW!

anyway,

my understanding is that the MS datatype BOOL is really an int. and TRUE is really 1 while FALSE is really 0.

i like to avoid the MS data types but that''s just b/c i like to make sure that whatever i''m compiling will also compile on Linux. or at least be as easy as possible to port when the time comes. obviously the MS data types don''t compile in linux...

if you''re writing MS code only use whichever.

-me

Share this post


Link to post
Share on other sites
So apart from being able to compile in lunix there isnt really much difference? The only reason Im asking is that some example uses the C++ types and some uses these Microsoft types which doesnt just applies to BOOL but also CHAR, INT, LONG, etc...
Just confused why there are two types.

Thanks all!

Share this post


Link to post
Share on other sites
Perhaps the idea was that using all caps would make it easier to redfine the types in the future - or to define them for different processors, but more likely the idea was to make it easier to distinguish the variable type from the variable name - especially considering their use of hungarian notation.

Another silly convention MS uses pertains to the kind of calls api functions use. The vast majority of them are __stdcall - but MS gives them all sorts of names - WINAPI, APIENTRY, WINOLEAPI, STDMETHODCALLTYPE, RPC_ENTRY - and more.

Share this post


Link to post
Share on other sites
quote:
Original post by davepermen
rightclick on the type and choose go to definition

please learn to use your application

"take a look around" - limp bizkit
www.google.com


What are you talking about? I know how to use my applications and what those data types are! Im just asking why there are two of them (ie CHAR and char) and is it better to use one over the over!

Thanks all for your help. I think I am going to stick with the C++ data type because they were there to begin with, also like Palidine said previously, can be compiled in Linux so good practice! =)

Share this post


Link to post
Share on other sites
BOOL is ugly because it is uppercase. I use bool myself. And I don't think BOOL is given a type color in MSVC like bool does.


[edited by - granat on May 7, 2002 2:25:34 PM]

Share this post


Link to post
Share on other sites