C Exercise Example 87

100 Classic C Examples

Title:Answer result (struct variable passing).

Program analysis:None.

Example

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

The output result is:

3,a

100 Classic C Examples

other extensions