0

having trouble finding this anywhere, on a 32bit computer, how many bytes does it take to store ; long int, unsigned char,float, double
any help is much appreciated

5
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by vmanes
0

long int - 4 bytes
char/unsigned char - 1 byte
float - 4 bytes
double - 8 bytes

The same for x64.

0

This is a very simple question you might have easily looked up from a search engine
you might consider that next time ;)

http://msdn.microsoft.com/en-us/library/s3f49ktz(v=vs.71).aspx

(edit) for the record the term is "Byte" as opposed to "Bite".
(edit2) it also might vary on how many bytes are actually used, depending on your compiler.

Edited by Suzie999

0

having trouble finding this anywhere, on a 32bit computer, how many bytes does it take to store ; long int, unsigned char,float, double

You're having trouble finding it because there's no absolute answer. Only char has a guaranteed size (it's always going to be 1), the rest are implementation dependent (though nullptr listed common sizes on a 32-bit implementation).

0

Of course, on any given system (OS + compiler) on which you work, you can check the size of each data type with the sizeof( ) operator.

cout << sizeof( int );  //repeat for each type you're interested in.

The sizes that were given above are quite common. You'll most often find differences in the long double type.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.