1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| #include <iostream> using namespace std;
int main() { char c1 = 'a'; char16_t c2 = u'好'; char32_t c3 = U'💩'; wchar_t c4 = L'你'; cout << sizeof c1 << endl; cout << sizeof c2 << endl; cout << sizeof c3 << endl; cout << sizeof c4 << endl; cout << c1 << endl; cout << c2 << endl; cout << c3 << endl; cout << c4 << endl; const char str[] = u8"你好"; const char str2[] = "你好"; cout << str << endl; cout << str2 << endl; float a = 1e-3F; unsigned long long b = 42ULL; long double c = 3.1415926L;
cout << a << endl; cout << b << endl; cout << c << endl;
return 0; }
|