Search code examples
c++cwinapiplatform-sdk

What is different between uppercase and lowercase data type?


For Example int and INT. About this two i just know int is the fundamental type and INT is windows data type both gain 4 bytes in memory and INT is use with window API.

But i don't understand what is the major and proper different between both of them.

Help me to understand this both fully?


Solution

  • int is a language keyword, INT is not.

    The size and range of values that an int can take is constrained, but not fixed, by the C++ standard.

    INT is a data type defined by Windows that is a 4 byte signed integral type with 2's complement.

    With a MSVC compiler targetting Windows, it is probably typedeffed or #defined to int, since int in that case has the required characteristics.

    Using std::int32_t would be preferable as it's multiplatform, although a compiler does not have to support it.