
u0301.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 | #include <iostream> int main() { std::cout << "bool: " << sizeof ( bool ) << std::endl; return 0; } /* Kaiching Chang u0301.cpp 2014-02 */ |
u0302.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #include <iostream> int main() { std::cout << "char: " << sizeof ( char ) << std::endl; std::cout << "wchar_t: " << sizeof ( wchar_t ) << std::endl; std::cout << "char16_t: " << sizeof (char16_t) << std::endl; std::cout << "char32_t: " << sizeof (char32_t) << std::endl; return 0; } /* Kaiching Chang u0302.cpp 2014-02 */ |
u0303.cpp
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | #include <iostream> int main() { std::cout << "short : " << sizeof ( short ) << std::endl; std::cout << "short int : " << sizeof ( short int ) << std::endl; std::cout << "signed short : " << sizeof ( signed short ) << std::endl; std::cout << "signed short int : " << sizeof ( signed short int ) << std::endl; std::cout << "unsigned short : " << sizeof (unsigned short ) << std::endl; std::cout << "unsigned short int : " << sizeof (unsigned short int ) << std::endl; std::cout << "int : " << sizeof ( int ) << std::endl; std::cout << "signed : " << sizeof ( signed ) << std::endl; std::cout << "signed int : " << sizeof ( signed int ) << std::endl; std::cout << "unsigned : " << sizeof (unsigned) << std::endl; std::cout << "unsigned int : " << sizeof (unsigned int ) << std::endl; std::cout << "long : " << sizeof ( long ) << std::endl; std::cout << "long int : " << sizeof ( long int ) << std::endl; std::cout << "signed long : " << sizeof ( signed long ) << std::endl; std::cout << "signed long int : " << sizeof ( signed long int ) << std::endl; std::cout << "unsigned long : " << sizeof (unsigned long ) << std::endl; std::cout << "unsigned long int : " << sizeof (unsigned long int ) << std::endl; std::cout << "long long : " << sizeof ( long long ) << std::endl; std::cout << "long long int : " << sizeof ( long long int ) << std::endl; std::cout << "signed long long : " << sizeof ( signed long long ) << std::endl; std::cout << "signed long long int: " << sizeof ( signed long long int ) << std::endl; std::cout << "unsigned long long : " << sizeof (unsigned long long ) << std::endl; std::cout << "unsigned long long int: " << sizeof (unsigned long long int ) << std::endl; return 0; } /* Kaiching Chang u0303.cpp 2014-02 */ |
u0304.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include <iostream> int main() { std::cout << "float: " << sizeof ( float ) << std::endl; std::cout << "double: " << sizeof ( double ) << std::endl; std::cout << "long double: " << sizeof ( long double ) << std::endl; return 0; } /* Kaiching Chang u0304.cpp 2014-02 */ |
the end

沒有留言:
張貼留言