Computer memory

closed account (LN7oGNh0)
How much memory does a long long int take? I have a 64 bit computer. I was wondering cause I have used them around 2 or 3 times and am worried that I might be using too much memory. (I know memory isnt a problem with modern computers but still, this a long long int.)

Thanks
A long long int is defined to occupy at least 64 bits, and it is exactly 64 bits everywhere I know of.
closed account (LN7oGNh0)
huh?
closed account (LN7oGNh0)
Does it take that much space??? I thought my computer was 64 bit?
You could use sizeof to find out:

1
2
3
4
5
6
7
8
9
10
#include <iostream>
using namespace std;

int main(){
cout << "int           " << sizeof(int) << endl;
cout << "bool          " << sizeof(bool) << endl;
cout << "double        " << sizeof(double) << endl;
cout << "char          " << sizeof(char) << endl;
cout << "long long int " << sizeof(long long int) << endl;
}
closed account (LN7oGNh0)
ya, just found out about this stuff. Dont worry guys im fine
When you say your computer is 64-bit, it means your computer can handle 64-bits per instruction. It has nothing to do with the memory that your computer has, such as DRAM or HDD space (although it does affect the maximum amount of DRAM your PC can accommodate). I'm no expert, but this should mean that when working with long long int's, your computer should be able to run calculations without breaking the integer into two different pieces.
The 64-bit thingy means your common unit of measure (int) should be 64 bits 'big', and also your pointers are 64-bits 'big'. It has not directly anything to do with long long ints. Run the test posted by Marcos Modenesi to find out the byte-size (multiply by 8 to get the bitsize)
Topic archived. No new replies allowed.