📄 specify.cpp
字号:
//: C03:Specify.cpp
// From Thinking in C++, 2nd Edition
// at http://www.BruceEckel.com
// (c) Bruce Eckel 1999
// Copyright notice in Copyright.txt
// Demonstrates the use of specifiers
#include <iostream>
using namespace std;
int main() {
char c;
unsigned char cu;
int i;
unsigned int iu;
short int is;
short iis; // Same as short int
unsigned short int isu;
unsigned short iisu;
long int il;
long iil; // Same as long int
unsigned long int ilu;
unsigned long iilu;
float f;
double d;
long double ld;
cout << "sizeof(char) = " << sizeof(c) << endl;
cout << "sizeof(unsigned char) = " << sizeof(cu) << endl;
cout << "sizeof(int) = " << sizeof(i) << endl;
cout << "sizeof(unsigned int) = " << sizeof(iu) << endl;
cout << "sizeof(short) = " << sizeof(is) << endl;
cout << "sizeof(unsigned short) = " << sizeof(isu) << endl;
cout << "sizeof(long) = " << sizeof(il) << endl;
cout << "sizeof(unsigned long) = " << sizeof(ilu) << endl;
cout << "sizeof(float) = " << sizeof(f) << endl;
cout << "sizeof(double) = " << sizeof(d) << endl;
cout << "sizeof(long double) = " << sizeof(ld) << endl;
} ///:~
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -