From 41523df2b162a598ed3f668d7c36b901054b122b Mon Sep 17 00:00:00 2001 From: EliteTK Date: Wed, 26 Feb 2014 01:24:20 +0000 Subject: stuff --- .gitignore | 1 + compressc.c | 5 +++++ example.c | 25 +++++++++++++++++++++++++ example_comp_man.c | 3 +++ sleep.c | 12 ++++++++++++ 5 files changed, 46 insertions(+) create mode 100644 compressc.c create mode 100644 example.c create mode 100644 example_comp_man.c create mode 100644 sleep.c diff --git a/.gitignore b/.gitignore index 587cfc3..c7014cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ * !*.c +!*.h diff --git a/compressc.c b/compressc.c new file mode 100644 index 0000000..e8f0f63 --- /dev/null +++ b/compressc.c @@ -0,0 +1,5 @@ +#include + +int main(void) { + printf("WIP\n"); +} 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 +#include + +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; +} diff --git a/example_comp_man.c b/example_comp_man.c new file mode 100644 index 0000000..b6845e6 --- /dev/null +++ b/example_comp_man.c @@ -0,0 +1,3 @@ +#include +#include +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;} diff --git a/sleep.c b/sleep.c new file mode 100644 index 0000000..e9a2dec --- /dev/null +++ b/sleep.c @@ -0,0 +1,12 @@ +#include +#include + +int main(void) { + printf("This is before the sleep.\n"); + sleep(10); + printf("This is after the sleep and before the for loop.\n"); + long i; + for(i = 0; i < 999999999999999; i++) + ; + printf("This is after the for loop.\n"); +} -- cgit v1.2.3-54-g00ecf