0
Consider this program: Q. Why it is returning size of var as 4 where var is an integer
cout << "char: " << sizeof(char) << endl; cout << "int: " << sizeof(int) << endl; cout << "float: " << sizeof(float) << endl; cout << "double: " << sizeof(double) << endl; int var = 50; cout << "var: " << sizeof(var) << endl; /* Outputs char: 1 int: 4 float: 4 double: 8 var: 4 */
3 Answers
0
How int has size 4 bytes float has the size of 4 bytes int has 2 bytes