day 2. 结构体与指针两种引用的方法
来源:互联网 发布:understand mac注册码 编辑:程序博客网 时间:2024/06/06 00:17
#include <stdio.h>
#include <string.h>
#include <string.h>
struct Student
{
int sid;
char name[200];
int age;
}; //分号不能省;
void f(struct Student * pst);
void g(struct Student st);
void g2(struct Student * pst);
{
int sid;
char name[200];
int age;
}; //分号不能省;
void f(struct Student * pst);
void g(struct Student st);
void g2(struct Student * pst);
int main (void)
{
struct Student st;
f(&st);
zhi2(&st);
//printf("%d %s %d\n",st.sid,st.name,st.age);
return 0;
}
{
struct Student st;
f(&st);
zhi2(&st);
//printf("%d %s %d\n",st.sid,st.name,st.age);
return 0;
}
void zhi1(struct Student st) //内存,不建议使用
{
printf("%d %s %d\n",st.sid,st.name,st.age);
}
{
printf("%d %s %d\n",st.sid,st.name,st.age);
}
void zhi2(struct Student * pst)
{
printf("%d %s %d\n",pst->sid,pst->name,pst->age);
}
{
printf("%d %s %d\n",pst->sid,pst->name,pst->age);
}
void f(struct Student * pst)
{
(*pst).sid=99;
strcpy(pst->name,"zhangsan");
pst->age=23;
}
阅读全文
0 0
- day 2. 结构体与指针两种引用的方法
- 结构体的引用与结构体指针的引用
- 函数调用参数改变的两种方法——指针与引用
- C++语言复习八 结构体指针(指向类的指针)的两种引用方式。
- 为结构体中函数指针赋值的两种方法
- 结构体变量成员的引用(两种方式)
- 引用外部css的两种方法与@import
- C语言——结构体与指针引用&结构体数组与指针引用
- 结构体指针的定义和引用
- 结构体指针的定义和引用
- 结构体指针的定义和引用
- 结构体指针的定义和引用
- 结构体指针的定义和引用
- day(3) Cocos2dx输出Log的两种方法
- 通过数组初始化链表的两种方法:指向指针的引用node *&tail和指向指针的指针(二维指针)node **tail
- Linux C 深入分析结构体指针的定义与引用
- Linux C 深入分析结构体指针的定义与引用
- 深入分析C语言中结构体指针的定义与引用详解
- 基于简单感知器分类算法(matlab实现)
- 八数码第八境界——IDA*+逆序数判无解
- 日志系列之Log4j2异步Loggers
- 前端解决跨域问题的8种方案
- 封装MyFragment
- day 2. 结构体与指针两种引用的方法
- 将ES中的数据推到kafka中,用kylin进行OLAP计算,发现统计数据对不上
- 数据结构——四种最常见的线性表
- which,that 引导定语从句不同
- 常用的sql语句
- 基于C均值算法简单分类(matlab实现)
- 贝叶斯网络结构学习之MCMC算法(基于FullBNT-1.0.4的MATLAB实现)
- 博客前言
- 升级Fedora