Easy Tutorial
❮ C Function Asin C Function Setvbuf ❯

C Exercise Example 87

C Language Classic 100 Examples

Title: Result Response (Structure Variable Passing).

Program Analysis: None.

Example

//  Created by www.tutorialpro.org on 15/11/9.
//  Copyright © 2015 tutorialpro.org. 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';
}

Output result:

3,a

C Language Classic 100 Examples

❮ C Function Asin C Function Setvbuf ❯