C 练习实例87

C语言教程1

C 练习实例87

题目:回答结果(结构体变量传递)。

程序分析:无。文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili87.html

实例

#include<stdio.h>

struct student
{
    int x;
    char c;
} a;

int main()
{
    a.x=3;
    a.c='a';
    f(a);
    printf("%d,%c",a.x,a.c);
}
f(struct student b)
{
    b.x=20;
    b.c='y';
}

输出结果为:文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili87.html

3,a
文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili87.html文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili87.html
运营不易,
感谢支持!
weinxin
我的微信
我的微信公众号
我的微信公众号扫一扫
weinxin
我的公众号
 最后更新:2021-12-7
公式库网
  • 本文由 公式库网 发表于 2021年12月6日21:20:01
  • 转载请务必保留本文链接:https://www.gongshiku.com/html/202112/c-lianxishili87.html

发表评论