[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1758
  • Last Modified:

Difference among types: int, int32_t, __int32...


a quick question:

I saw different programs written by using different type notations for integer, like:

int
int32_t
__int32

is there any difference? or what's the guideline i should follow when writing codes?

thanks!
0
adairwu
Asked:
adairwu
1 Solution
 
brettmjohnsonCommented:
int is the only built-in type you mention. It is the native integer size for the processor.  Since the sizeof(int) is not fixed in C (as it is in Java), many programmers define types for 8, 16, 32, and 64 bit integers that are not ambiguous.   Recently, most systems are defining them in system header files (like types.h) using common nomenclature.  int32_t is common in Unix and gcc environments.  __int32 is favored by Microsoft (leading underscores used because it is not officially part of the ANSI standard).

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now