⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prog3_02.cpp

📁 c++最经典的入门书籍
💻 CPP
字号:
// Program 3.2 Finding the sizes of data types
#include <iostream>
using std::cout;
using std::endl;

int main() {
  // Output the sizes for integer types
  cout << endl 
       << "Size of type char is "
       << sizeof(char);
  cout << endl 
       << "Size of type short is "
       << sizeof(short);
  cout << endl 
       << "Size of type int is "
       << sizeof(int);
  cout << endl 
       << "Size of type long is "
       << sizeof(long);

  // Output the sizes for floating point types
  cout << endl 
       << "Size of type float is "
       << sizeof(float);
  cout << endl 
       << "Size of type double is "
       << sizeof(double);
  cout << endl 
       << "Size of type long double is "
       << sizeof(long double);
  cout << endl;
  return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -