Added an example with a struct.
[C-Programming-Examples.git] / struct.c
blobdea85d58cd5316091cb1042565bf3dd01643b539
1 #include <stdio.h>
3 struct symbol_hash {
4 char *name;
5 int address;
6 };
8 int main()
10 struct symbol_hash symbol_hash[512];
12 symbol_hash[0].name = "This is a long string of data";
14 printf("hash name %s\n", symbol_hash[0].name);
16 symbol_hash[0].name = "This is a short string.";
18 printf("hash name %s\n", symbol_hash[0].name);
20 symbol_hash[0].address = 4;
22 printf("hash add %d\n", symbol_hash[0].address);
23 return 1;