From: Chris Date: Mon, 9 Feb 2015 14:34:20 +0000 (+0100) Subject: File closen.. X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=4f0c543fb7796005f4e0bfa43869e179ce52936b;p=sws1-1415.git File closen.. --- diff --git a/ass2/chris/sws1-s4109503-s4202015/exercise1b.c b/ass2/chris/sws1-s4109503-s4202015/exercise1b.c index f1c9f23..4a844dc 100644 --- a/ass2/chris/sws1-s4109503-s4202015/exercise1b.c +++ b/ass2/chris/sws1-s4109503-s4202015/exercise1b.c @@ -1,12 +1,12 @@ #include int main(){ - FILE *fp; - fp = fopen("/dev/urandom","r"); + FILE *fp = fopen("/dev/urandom","r"); char buffer = 0; do{ fread(&buffer, 1, 1, fp); printf("%i %u %#x \n",buffer, buffer, buffer); } while(buffer != 42); + fclose(fp); return 0; }