author | Markus Bröker <mbroeker@largo.dyndns.tv> |
Thu, 16 Apr 2009 12:50:39 +0200 | |
changeset 67 | abe63a276a36 |
parent 9 | c3fecc82ade6 |
child 77 | 49e0babccb23 |
permissions | -rw-r--r-- |
0 | 1 |
/** |
9
c3fecc82ade6
standard tags for git projects
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
8
diff
changeset
|
2 |
* test/demos/nomalloc.c |
c3fecc82ade6
standard tags for git projects
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
8
diff
changeset
|
3 |
* Copyright (C) 2008 Markus Broeker |
0 | 4 |
*/ |
5 |
||
6 |
#include <stdio.h> |
|
8
96d16dfe787a
We use return EXIT_SUCCESS instead of return 0
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
0
diff
changeset
|
7 |
#include <stdlib.h> |
0 | 8 |
|
9 |
struct Names { |
|
10 |
char *name; |
|
11 |
int age; |
|
12 |
}; |
|
13 |
||
14 |
void setStruct (struct Names *names) |
|
15 |
{ |
|
16 |
names->name = "mbroeker"; |
|
17 |
names->age = 32; |
|
18 |
} |
|
19 |
||
20 |
void printStruct (struct Names *names) |
|
21 |
{ |
|
22 |
printf ("Name: %s\n", names->name); |
|
23 |
printf (" Age: %d\n", (*names).age); |
|
24 |
} |
|
25 |
||
26 |
int main (int argc, char **argv) |
|
27 |
{ |
|
28 |
struct Names names; |
|
29 |
||
30 |
setStruct (&names); |
|
31 |
printStruct (&names); |
|
32 |
||
8
96d16dfe787a
We use return EXIT_SUCCESS instead of return 0
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
0
diff
changeset
|
33 |
return EXIT_SUCCESS; |
0 | 34 |
} |