On 2/10/2012 07:14, Jim Michaels wrote:
> 
> hi...
> 
> does anyone know what sizeof(size_t) is in 64-bit systems?
> 
> #include <iostream>
> #include <string>
> using namespace std;
> int main(void) {
>     cout<<sizeof(size_t)<<endl;
>     return 0;
> }
> 
> this needs to be run on a 64-bit system.  I have a 32-bit system.  I could 
> use the help.  I use the auto build.
> 
> the help is appreciated.  on a 32-bit system, this program prints out 4.  IF 
> it prints out 8 on a 64-bit system, I have a problem to address, and I need 
> to stuff in a lot of #ifdefs
> because fprintf is unforgiving of data
>  types (I can only think of %I64u and %lu, no resizeable size_t data types), 
> and I have no clue how to switch streams between cout and ostream safely.

have you tried up casting it to 64bit regardless of platform?

printf("%"PRIdu4"\n",uint64_t(my_size_t));


Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to