author | Markus Brökers <mbroeker@largo.homelinux.org> |
Sun, 29 Aug 2010 15:29:22 +0200 | |
changeset 144 | f064cd793f8d |
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 |
} |