aboutsummaryrefslogtreecommitdiffstats
path: root/example.c
diff options
context:
space:
mode:
Diffstat (limited to 'example.c')
-rw-r--r--example.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/example.c b/example.c
new file mode 100644
index 0000000..e643da5
--- /dev/null
+++ b/example.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+struct test {
+ int number;
+ char letter;
+ char *string;
+};
+
+void printstruct( const struct test * );
+
+int main( int argc, char *argv[] ) {
+ struct test cake;
+ cake.number = 5;
+ cake.letter = 'a';
+ cake.string = "Magic";
+
+ printstruct( &cake );
+ return 0;
+}
+
+void printstruct( const struct test * testp ) {
+ printf("Number: %d\nLetter: %c\nString: %s\n", testp->number, testp->letter, testp->string);
+ return;
+}