-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauto.cpp
More file actions
23 lines (21 loc) · 841 Bytes
/
auto.cpp
File metadata and controls
23 lines (21 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>
int main(){
auto var1 {12};
auto var2 {13.0};
auto var3{14.0f};
auto var4{15.0l};
auto var5{'e'};
//int modifiter suffixes
auto var6 {123u};
auto var7{123ul};
auto var8{123ll};
std::cout<<"var1 occupies : " <<sizeof(var1)<<" bytes"<<std::endl;
std::cout<<"var2 occupies : " <<sizeof(var2)<<" bytes"<<std::endl;
std::cout<<"var3 occupies : " <<sizeof(var3)<<" bytes"<<std::endl;
std::cout<<"var4 occupies : " <<sizeof(var4)<<" bytes"<<std::endl;
std::cout<<"var5 occupies : " <<sizeof(var5)<<" bytes"<<std::endl;
std::cout<<"var6 occupies : " <<sizeof(var6)<<" bytes"<<std::endl;
std::cout<<"var7 occupies : " <<sizeof(var7)<<" bytes"<<std::endl;
std::cout<<"var8 occupies : " <<sizeof(var8)<<" bytes"<<std::endl;
return 0;
}