author | Markus Bröker <mbroeker@volpe.spectre.org> |
Wed, 18 Aug 2010 16:14:40 +0200 | |
changeset 140 | 05d42a3737a4 |
parent 77 | 49e0babccb23 |
permissions | -rw-r--r-- |
0 | 1 |
/** |
77 | 2 |
* nomalloc.c |
9
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 |
} |