Misha Brukman | 81f6ee8 | 2004-08-11 14:16:34 +0000 | [diff] [blame^] | 1 | void printf(char*, ...); |
| 2 | |
| 3 | typedef struct params_ { |
| 4 | int i1; |
| 5 | float f1; |
| 6 | double d1; |
| 7 | short s1; |
| 8 | double d2; |
| 9 | char c1; |
| 10 | unsigned short s2; |
| 11 | float f2; |
| 12 | int i2; |
| 13 | } params; |
| 14 | |
| 15 | void print_param(params p) { |
| 16 | printf("%d, %f, %f, %d, %f, %c, %d, %f, %d\n", |
| 17 | p.i1, p.f1, p.d1, p.s1, p.d2, p.c1, p.s2, p.f2, p.i2); |
| 18 | } |
| 19 | |
| 20 | void print_param_addr(params *p) { |
| 21 | printf("%d, %f, %f, %d, %f, %c, %d, %f, %d\n", |
| 22 | p->i1, p->f1, p->d1, p->s1, p->d2, p->c1, p->s2, p->f2, p->i2); |
| 23 | } |
| 24 | |
| 25 | int main() { |
| 26 | params p; |
| 27 | p.i1 = 1; |
| 28 | p.f1 = 2.0; |
| 29 | p.d1 = 3.0; |
| 30 | p.s1 = 4; |
| 31 | p.d2 = 5.0; |
| 32 | p.c1 = '6'; |
| 33 | p.s2 = 7; |
| 34 | p.f2 = 8.0; |
| 35 | p.i2 = 9; |
| 36 | print_param(p); |
| 37 | print_param_addr(&p); |
| 38 | return 0; |
| 39 | } |