author | Markus Bröker <mbroeker@largo.dyndns.tv> |
Fri, 27 Dec 2013 16:00:09 +0100 | |
changeset 167 | 7c6b221900bf |
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 |
} |