From 2a51e0ad268f66440c70a0284b73cfbc68f9806a Mon Sep 17 00:00:00 2001 From: Steven Schronk Date: Mon, 25 Jan 2010 12:12:49 -0600 Subject: [PATCH] Added an example with a struct. --- struct.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 struct.c diff --git a/struct.c b/struct.c new file mode 100644 index 0000000..dea85d5 --- /dev/null +++ b/struct.c @@ -0,0 +1,24 @@ +#include + +struct symbol_hash { + char *name; + int address; +}; + +int main() +{ + struct symbol_hash symbol_hash[512]; + + symbol_hash[0].name = "This is a long string of data"; + + printf("hash name %s\n", symbol_hash[0].name); + + symbol_hash[0].name = "This is a short string."; + + printf("hash name %s\n", symbol_hash[0].name); + + symbol_hash[0].address = 4; + + printf("hash add %d\n", symbol_hash[0].address); + return 1; +} -- 2.11.4.GIT