Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / October 2005



Tip: Looking for answers? Try searching our database.

sizeof(long long) = 4. Why?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jos - 31 Oct 2005 18:46 GMT
Hello,

I have a little question. I want to use 64 bit integer math (both G4/G5). I
thought the C++ defined 'long long' for 64-bit math, but if I print
sizeof(long long), returned value is 4. How to get this working?

My related questions are:

* Why is the sizeof(long long) 4?
* Do I need to add a GCC compiler switch to get this working?
* Do I need to use an another type (e.g. int64) and in which header file do
I need to include?

Thanks! Jos
Eric Albert - 31 Oct 2005 19:34 GMT
> I have a little question. I want to use 64 bit integer math (both G4/G5). I
> thought the C++ defined 'long long' for 64-bit math, but if I print
[quoted text clipped - 6 lines]
> * Do I need to use an another type (e.g. int64) and in which header file do
> I need to include?

sizeof(long long) is 8 on Mac OS X.  Can you show us your code?

-Eric

Signature

Eric Albert         ejalbert@cs.stanford.edu
http://outofcheese.org/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.