Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » Time for little quiz!
Re: Time for little quiz! [message #17892 is a reply to message #17891] Tue, 02 September 2008 08:56 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
[quote title=nixnixnix wrote on Mon, 01 September 2008 18:04]ok I am not quite up to understanding the full consequences of the above conversation. However, the bit (excuse the pun) that interests me is:

how many bits does an "int" have when I compile on a 64 bit OS (linux or vista - I am trying both)?

If I want my documents to load and save (using Serialize(Stream&)) between 32 and 64 bit implementations of my software, do I need to replace all "int" with "int32"? I am guessing this is so but what else will I need to change please?
[quote]

It "depends".

With x86-64, int is still 32 bits. And in fact, AFAIK, this is the most common arrangement for 64-bit systems.

To get "true" 64-bit integer, types vary more, but with U++, you can just use "int64".

Quote:


char is still 16 bit right?



char is always 8 bit.

wchar is now 16 bit, but it seems like we have to go 32-bit soon. But that should not affect the existing code too much.

Quote:


float is always 32 bit right?
double is always 64 bit right?



Yes.

Quote:


what about bool?



Frankly, I do not know Smile But I believe it is 1 for both GCC and MSC.

Quote:


what about String?



Current implementation 16. May change (before 2007, it was equal to sizeof(void*)).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: STL multimap
Next Topic: explanation of c++ typedef line
Goto Forum:
  


Current Time: Mon Sep 15 19:49:04 CEST 2025

Total time taken to generate the page: 0.19212 seconds