Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Standard C++ Types?

SephirothSephiroth Fayetteville, NC, USAMember Posts: 1,035
Is there an article or reference somewhere as to the standard types across Linux and Windows, x86 and x64 platforms for C++? I don't mean the standard "int", "long", and "short" stuff. I mean things like "INT32" and "INT64". I ask because I am reworking part of my OpenGL engine and I would like for it to work on all four platforms without recoding everything. For example, assume I used "INT64" everywhere in my program instead of "int". That would mean that whether I am on a 32bit or 64bit platform, I would be using the 64bit integer type. If I used "int" then on the 32bit version I would have a different limit as to the max value than on the 64bit version.

Anyway, is there a reference as to the standard types that are defined on 32bit Linux/Windows and 64bit Linux/Windows? I'd hate to have to write my own types header if it can be avoided. Thanks for the help!



  • Josh CodeJosh Code Member Posts: 675
    I'm pretty sure there is no cross platform standard like your asking for.

    When I port c/c++ code, I define my own types using typedef where necessary and test thoroughly especially for binary reading and writing. Reading and writing binary files is where most of the issues seem to come up for endianness and data type size.

Sign In or Register to comment.