From: Chris Date: Mon, 9 Feb 2015 15:28:25 +0000 (+0100) Subject: korter dan mart X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=52c181997e4f38d36ac47bf1dcbcb7aea5a1b14b;p=sws1-1415.git korter dan mart --- diff --git a/ass2/chris/sws1-s4109503-s4202015/exercise1d.c b/ass2/chris/sws1-s4109503-s4202015/exercise1d.c index 9a3874d..0143950 100644 --- a/ass2/chris/sws1-s4109503-s4202015/exercise1d.c +++ b/ass2/chris/sws1-s4109503-s4202015/exercise1d.c @@ -1,13 +1,13 @@ #include #include -int main(){ - FILE *fp = fopen("/dev/urandom","r"); - uint16_t read = 0; +int main(void){ + FILE *f = fopen("/dev/urandom","r"); + uint16_t r = 0; do{ - fread(&read, 2, 1, fp); - printf("%x \n", read); - }while(read != 42); - fclose(fp); + fread(&r, 2, 1, f); + printf("%x\n", r); + }while(r != 42); + fclose(f); return 0; }