UNIT

in my exercise, i found that there is a new datatype called "UNIT", i wonder whether it is unsigned int or not???
it's UINT. and it's not new.
and guess what the U stands for? :)
so UNIT and unsigned int are different?
can you explain it to me??

what is UNIT used for?
i don't know what UNIT is...
Is it UINT or UNIT? UINT sounds like a typedef for unsigned int.
sorry

UINT
Yes, UINT is (as far as I remember) a typedef for unsigned int, used in the Windows API (and maybe other places, too). See http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx#UINT
Last edited on
So int c plus plus we have to

typedef unsigned int UINT

before using it????
why dont we use unsigned int?? why we have to define UINT??? what for??

- thks-
We don't have to typedef it, not normally. Generally windows headers (e.g. #include <windows.h> ) will define it for you.

Generally, the reason for typedef is to separate it conceptually from something else. However, in this case I think its more so for the typedefs of PUINT or the like, which windows defines.

In short, yes you can use unsigned int, and the compiler won't care. However, if you do lots of programming for Windows, often you'll use their typedefs to fit in with the overall API.
i typedef it and it run nomally
Topic archived. No new replies allowed.