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

📄 stru_size01.cpp

📁 在c环境下的对数据结构进行讲解,包含有例题及答案
💻 CPP
字号:
//stru_size01.cpp
#include <iostream.h>			//cout,cin
#include <conio.h>			//getch()
struct rec
{ int chi,eng,math,total;
  float ave;
};
void main()
{ rec Bill;
  cout <<"各字段的大小:";
  cout <<"\nSize of chi=" << sizeof(Bill.chi);
  cout <<"\nSize of eng=" << sizeof(Bill.eng);
  cout <<"\nSize of math=" << sizeof(Bill.math);
  cout <<"\nSize of total=" << sizeof(Bill.total);
  cout <<"\nSize of ave=" << sizeof(Bill.ave);
  cout <<"\n结构大小=" << sizeof(Bill);
  cout <<"\n";
  getch();
}

⌨️ 快捷键说明

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