#include <iostream>
#include <math.h>
using namespace std;
int main() {
int i{100};
float f{3.14};
double d{3.14159};
cout<<"size of int is: " <<sizeof(i)<<endl;
cout<<"size of float is: " <<sizeof(f)<<endl;
cout<<"size of double is: "<<sizeof(d)<<endl<<endl;;
auto x = sin(3.14159);
cout<<"size of auto that is double is: "<<sizeof(x)<<endl<<endl;
auto y{sin(3.14159)};
cout<<"size of auto that is double is: "<<sizeof(y)<<endl;
return 0;
}
The output is:
size of int is: 4
size of float is: 4
size of double is: 8
size of auto that is double is: 8
size of auto that is double is: 16
Why is sizeof(y)
16?