sizeof (int) gives me 4 bytes...is it sufficient to say that my machine is of type 32-bit
SpS
34
Posting Pro
Recommended Answers
Jump to PostIs it the processor, the operating system or the compiler?
Old Albert is wrong, human stupidity is rather limited. Infinity is much too perfect!
Jump to PostThe size of ints is dependant upon the compiler or compiler setting. It would seem that your compiler defaultly uses 32-bit ints, as most "standard" C compilers should. The same code run on a 64-bit chip with a 64-bit OS will provide the same answer.
It wouldn't make much …
Jump to PostI would feel more comfortable trusting sizeof(void*) than sizeof(int).
I'm tempted to trust sizeof(size_t) too, but you never know...
All 12 Replies
Ene Uran
638
Posting Virtuoso
chrisbliss18
26
Posting Shark
Rashakil Fol
978
Super Senior Demiposter
Team Colleague
Narue
5,707
Bad Cop
Team Colleague
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
Rashakil Fol
978
Super Senior Demiposter
Team Colleague
SpS
34
Posting Pro
Narue
5,707
Bad Cop
Team Colleague
SpS
34
Posting Pro
Narue
5,707
Bad Cop
Team Colleague
SpS
34
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.