结构体嵌套
来源:互联网 发布:淘宝假学生证怎么办理 编辑:程序博客网 时间:2024/05/17 08:52
#include <stdio.h>
#define LEN 20
const char * msgs[5] ={
" Thank you for the wonderful evening, ",
"You certainly prove that a ",
"is a special kind of guy. We must get together",
"over a delicious ",
" and have a few laughs"
};
struct names { // first structure
char first[LEN];
char last[LEN];
};
struct guy { // second structure
struct names handle; // nested structure
char favfood[LEN];
char job[LEN];
float income;
};
int main(void)
{
struct guy fellow = { // initialize a variable
{ "Ewen", "Villard" },
"grilled salmon",
"personality coach",
58112.00
};
printf("Dear %s, \n\n", fellow.handle.first);
printf("%s%s.\n", msgs[0], fellow.handle.first);
printf("%s%s\n", msgs[1], fellow.job);
printf("%s\n", msgs[2]);
printf("%s%s%s", msgs[3], fellow.favfood, msgs[4]);
if (fellow.income > 150000.0)
puts("!!");
else if (fellow.income > 75000.0)
puts("!");
else
puts(".");
printf("\n%40s%s\n", " ", "See you soon,");
printf("%40s%s\n", " ", "Shalala");
return 0;
}
0 0
- 结构体的嵌套
- 48,结构体嵌套
- 结构体嵌套
- 结构体嵌套
- 小议嵌套结构体大小
- 结构体的嵌套问题
- 结构体的相互嵌套
- 结构体的嵌套问题
- 结构体的嵌套问题
- 结构体的嵌套问题
- C-046.结构体嵌套
- 结构体的嵌套使用
- 结构体的嵌套问题
- 结构体嵌套一级指针
- 结构体嵌套二级指针
- 结构体嵌套结构体名
- 结构体嵌套、结构体数组、排序
- 结构体指针 & 结构体嵌套使用...
- android内核编译
- 欢迎使用CSDN-markdown编辑器
- PanelMgr-----罗培羽
- Scala详解---------快速入门Scala
- Activity入门指南
- 结构体嵌套
- MySQL 5.7.17 ZIP安装教程及解决方案
- MySQL运算符
- 多线程_Java程序运行原理和JVM的启动是多线程的吗
- endnote使用笔记
- 腾讯2017暑期实习生编程题-C-有趣的数字
- 大型网站系统学习笔记(一)——单机到集群
- 浅论出版物的纸、电一体化新方向
- AlloyTouch之无限循环select插件