From: Chris Date: Mon, 9 Feb 2015 11:04:05 +0000 (+0100) Subject: Assignent 1a,b X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=da1e6dc584a8ce7ad4f8a32260130d26fdb15043;p=sws1-1415.git Assignent 1a,b --- diff --git a/.gitignore b/.gitignore index 10d00b5..0524e5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.gz +*.out diff --git a/ass2/chris/exercise1a.txt b/ass2/chris/sws1-s4109503-s4202015/exercise1a.txt similarity index 100% rename from ass2/chris/exercise1a.txt rename to ass2/chris/sws1-s4109503-s4202015/exercise1a.txt diff --git a/ass2/chris/sws1-s4109503-s4202015/exercise1b.c b/ass2/chris/sws1-s4109503-s4202015/exercise1b.c new file mode 100644 index 0000000..251e693 --- /dev/null +++ b/ass2/chris/sws1-s4109503-s4202015/exercise1b.c @@ -0,0 +1,13 @@ +#include + +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; +}