C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28695
Number of posts: 94715

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Standard C++ Types? Posted by Sephiroth on 26 Sept 2010 at 11:06 AM
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!

-Sephiroth
Report
Re: Standard C++ Types? Posted by Josh Code on 29 Sept 2010 at 9:51 PM
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.





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.