File closen..
authorChris <mail@chriskamphuis.com>
Mon, 9 Feb 2015 14:34:20 +0000 (15:34 +0100)
committerChris <mail@chriskamphuis.com>
Mon, 9 Feb 2015 14:34:20 +0000 (15:34 +0100)
ass2/chris/sws1-s4109503-s4202015/exercise1b.c

index f1c9f23..4a844dc 100644 (file)
@@ -1,12 +1,12 @@
 #include<stdio.h>
 
 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;
 }