Latest web development tutorials

C 練習實例87

C 語言經典100例 C語言經典100例

題目:回答結果(結構體變量傳遞)。

程序分析:無。

程序源代碼:

//  Created by www.w3big.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';
}

C 語言經典100例 C語言經典100例