Assignent 1a,b
authorChris <mail@chriskamphuis.com>
Mon, 9 Feb 2015 11:04:05 +0000 (12:04 +0100)
committerChris <mail@chriskamphuis.com>
Mon, 9 Feb 2015 11:04:05 +0000 (12:04 +0100)
.gitignore
ass2/chris/sws1-s4109503-s4202015/exercise1a.txt [moved from ass2/chris/exercise1a.txt with 100% similarity]
ass2/chris/sws1-s4109503-s4202015/exercise1b.c [new file with mode: 0644]

index 10d00b5..0524e5d 100644 (file)
@@ -1 +1,2 @@
 *.gz
+*.out
diff --git a/ass2/chris/sws1-s4109503-s4202015/exercise1b.c b/ass2/chris/sws1-s4109503-s4202015/exercise1b.c
new file mode 100644 (file)
index 0000000..251e693
--- /dev/null
@@ -0,0 +1,13 @@
+#include<stdio.h>
+
+int main(){
+       FILE *fp;
+       fp = fopen("/dev/urandom","r");
+       char buffer = 0;
+       do{
+               fread(&buffer, 1, 1, fp);
+               printf("%i, %u, %#x",buffer, buffer, buffer);
+               printf("\n");
+       } while(buffer != 42);
+       return 0;
+}