0
What is the output of this code?why?
int main () { static double i; i=20; cout<<sizeof(i); }
2 odpowiedzi
+ 3
The code outputs 8, which is the size (in bytes) of a double type variable i, why? the sizeof() returns that value (the double type variable i size) and cout stream the value to the screen.
Hth, cmiiw
+ 1
Output is 8 because sizeof is a function that returns the size of a variable or a constant. The default size of double is 8 bytes