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

Posted on 2006-03-20
Last Modified: 2012-08-13

a quick question:

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


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

Question by:adairwu
    1 Comment
    LVL 23

    Accepted Solution

    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).


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
    This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
    The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
    The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now