0
what is long and short in data types ?
2 Respuestas
+ 2
#include <iostream>
using namespace std;
int main() {
cout << "long:" << sizeof(long) << endl;
cout << "short:" << sizeof(short) << endl;
return 0;
}
a long data type is a whole number that is >= the standard int. A short data type is for numbers that take up less storage. Take this code and run it and you should get
4
2
0
and why would i need it in the first place , i mean isn't declaring a variable as integer or say floating point is enough to assign any kind of numbers to it ?