C语言_结构体变量指针做函数参数的使用案例
2024-10-11 23:50:56
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <malloc.h> //创建一个结构体
typedef struct programmer
{
int salary;
int experience;
char type[]; } Programmer; void OneyearLater(Programmer *);
int main ()
{
Programmer p = {, , "PHP"};
printf("岗位:%s\n当前薪资:%-5d\n当前经验:%d年\n",p.type, p.salary, p.experience);
OneyearLater(&p);
printf("------------------一年后---------------------\n");
printf("岗位:%s\n当前薪资:%-5d\n当前经验:%d年\n",p.type, p.salary, p.experience); return ;
}
//一年后
void OneyearLater(Programmer *p)
{
p->salary = ;
p->experience = ; }
最新文章
- 高性能IO模型浅析
- 响应式图片srcset学习
- Java关键字——static
- Linux awk命令详解??????????(研究)
- MySQL数据库获取汉字拼音的首字母函数
- loadrunner java协议脚本要点
- VS2010 Command Prompt Error:Cannot determine the location of the VS Common Tools folder
- Java Final and Immutable
- TCP/IP(二)物理层详解
- 无废话XML--XML约束(schema)
- 【转载】Linux时间相关结构与函数
- (转)Centos下,Docker部署Yapi接口管理平台
- Web高级 HTTP报文
- 【转】AJAX 跨域请求 - JSONP获取JSON数据
- Windows环境安装MySQL数据库
- nginx的80端口跳转到443
- RSA 加密 解密 公钥 私钥 签名 加签 验签
- Php文件上传类class.upload.php
- JS原生事件处理(跨浏览器)
- Python -----issubclass和isinstance
热门文章
- Windows 性能搜集【perfmon】
- 浅谈Await
- 【转】globk通常的应用
- opencv学习手稿(01开篇-显示一张图片)
- [DeeplearningAI笔记]改善深层神经网络_优化算法2.3_2.5_带修正偏差的指数加权平均
- [DeeplearningAI笔记]改善深层神经网络_深度学习的实用层面1.9_归一化normalization
- Ubuntu16.04下伪分布式环境搭建之hadoop、jdk、Hbase、phoenix的安装与配置
- JAVA动态代理机制解析
- 在CentOS7上实现NFS共享
- Sonar 常用代码规则整理(一)