Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
fundamental type sizes
//Title of this code #include <iostream> using namespace std; int main() { char c08 = 'a'; char16_t c16 = 'b'; char32_t c32 = 'c'; cout << "Char types sizes" << endl << endl; cout << "Size of char:\t\t " << sizeof(char) << " bytes." << " or " << sizeof(char)*8 << " bits" << endl; cout << "Size of char16_t:\t " << sizeof(char16_t) << " bytes." << " or " << sizeof(char16_t)*8 << " bits" << endl; cout << "Size of char32_t:\t " << sizeof(char32_t) << " bytes." << " or " << sizeof(char32_t)*8 << " bits" << endl; cout << endl; cout << "Integer types (signed) sizes" << endl << endl; cout << "Size of char:\t\t " << sizeof(char) << " bytes." << " or " << sizeof(char)*8 << " bits" << endl; cout << "Size of short:\t\t " << sizeof(short) << " bytes." << " or " << sizeof(short)*8 << " bits" << endl; cout << "Size of int:\t\t " << sizeof(int) << " bytes." << " or " << sizeof(int)*8 << " bits" << endl; cout << "Size of long:\t\t " << sizeof(long) << " bytes." << " or " << sizeof(long)*8 << " bits" << endl; cout << "Size of long long:\t " << sizeof(long long) << " bytes." << " or " << sizeof(long long)*8 << " bits" << endl; cout << endl; cout << "Floating-point typessizes" << endl << endl; cout << "Size of float:\t\t " << sizeof(float) << " bytes." << " or " << sizeof(float)*8 << " bits" << endl; cout << "Size of double:\t\t " << sizeof(double) << " bytes." << " or " << sizeof(double)*8 << " bits" << endl; cout << "Size of long double:\t " << sizeof(long double) << " bytes." << " or " << sizeof(long double)*8 << " bits" << endl; cout << endl; cout << "Size of boolean:\t" << sizeof(bool) << " bytes or " << (sizeof(bool)*8) << endl << endl; string r1 = R"(string with \backslash)"; string r2 = R"s4r(string with \backslash)s4r"; string s1 = "string with \backslash"; string s2 = "string with \\backslash"; cout << "r1 = " << r1 << endl; cout << "r2 = " << r2 << endl; cout << "s1 = " << s1 << endl; cout << "s2 = " << s2 << endl; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Simple enemy polimorphism
Vector+-OpLoad
Ineritance
cppPyClass
Goooood
lab17feb22x4B.cpp
带头结点的单链表
Kishan_Basic_Geometry
a simple tuple implementation
Sum of digits of number
Please log in to post a comment.