结构体和数组
来源:互联网 发布:mac os x high sierra 编辑:程序博客网 时间:2024/06/05 17:33
#include <iostream>using namespace std;struct Student{char name[20];bool gender;char addr[100];double sorce;};void show(Student s){cout << s.name << "是一位" << (s.gender? "帅哥" : "美女") << "来自" << s.addr << "成绩是:" << s.sorce << endl;}int main(){Student s[3] = {{"weijun", true, "平湖",98},{"lisi",true,"南京",90},{"xiaoV",false,"北京",97}};for (int i=0; i<3; i++){show(s[i]);}return 0;}
阅读全文
0 0
- 结构体和数组
- 结构体和数组
- 结构体和数组
- 结构体数组和结构体指针
- 结构体指针和结构体数组
- 老码识途 数组和结构体
- 结构体指针和数组
- 元胞数组和结构体数组
- 结构体数组的定义和引用
- struct 结构体中 数组和指针
- byte数组和结构体相互转换
- 结构体数组的定义和引用
- struct 结构体中 数组和指针
- 结构体(有数组和指针)
- UE4结构体数组 定义和访问
- 数组--结构体数组
- Linux学习-结构体数组和结构体指针
- 指针,数组和结构
- Java的特点
- Billboard 线段树
- [bzoj1643][Usaco2007 Oct]Bessie's Secret Pasture 贝茜的秘密草坪
- 创建触发器
- Expedition
- 结构体和数组
- c#事件委托
- HRMS CentOS6.x x86 Tomcat7.x MySQL5.7.17 html5 springMVC hibernate
- jemalloc横向分析(五)tcache分配内存
- 仿QQ语音变声功能实现(二)---移植到android studio 并解决部分问题
- AI机器学习(一)背景及环境(C#)
- sklearn文档 — 1.9. 朴素贝叶斯
- python类型转换
- 算法-合并两个排序的链表