-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4.28.cpp
More file actions
24 lines (20 loc) · 868 Bytes
/
4.28.cpp
File metadata and controls
24 lines (20 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
using std::cout;
using std::endl;
int main() {
cout << "bool: " << sizeof(bool) << " bytes" << endl;
cout << "char: " << sizeof(char) << " bytes" << endl;
cout << "wchar_t: " << sizeof(wchar_t) << " bytes" << endl;
cout << "char16_t: " << sizeof(char16_t) << " bytes" << endl;
cout << "char32_t: " << sizeof(char32_t) << " bytes" << endl;
cout << "short: " << sizeof(short) << " bytes" << endl;
cout << "int: " << sizeof(int) << " bytes" << endl;
cout << "long: " << sizeof(long) << " bytes" << endl;
cout << "long long: " << sizeof(long long) << " bytes" << endl;
cout << "float: " << sizeof(float) << " bytes" << endl;
cout << "double: " << sizeof(double) << " bytes" << endl;
cout << "long double: " << sizeof(long double) << " bytes" << endl;
int i, *p = &i;
cout << "pointer: " << sizeof(p) << " bytes" << endl;
return 0;
}