C 練習例87
問題:回答結果(構造体変数の受け渡し)。
プログラム分析:なし。
例
// Created by www.example.com on 15/11/9.
// Copyright © 2015年 サンプル. All rights reserved.
//
#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';
}
出力結果は:
3,aその他の拡張