aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliteTK <tomasz.kramkowski@gmail.com>2014-02-26 01:24:20 +0000
committerEliteTK <tomasz.kramkowski@gmail.com>2014-02-26 01:24:20 +0000
commit41523df2b162a598ed3f668d7c36b901054b122b (patch)
tree5cc3b4a6bf250961b92def41d860d2526d6ff0cb
parentfdd18abebe52d9610d6e613fa92aa376d422e41e (diff)
downloadc-stuff-41523df2b162a598ed3f668d7c36b901054b122b.tar.gz
c-stuff-41523df2b162a598ed3f668d7c36b901054b122b.tar.xz
c-stuff-41523df2b162a598ed3f668d7c36b901054b122b.zip
stuff
-rw-r--r--.gitignore1
-rw-r--r--compressc.c5
-rw-r--r--example.c25
-rw-r--r--example_comp_man.c3
-rw-r--r--sleep.c12
5 files changed, 46 insertions, 0 deletions
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<stdio.h>
+
+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 <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;
+}
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 <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;}
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<stdio.h>
+#include<stdlib.h>
+
+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");
+}