repositories
/
sws1-1415.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4cd4276
)
korter dan mart
author
Chris
<mail@chriskamphuis.com>
Mon, 9 Feb 2015 15:28:25 +0000
(16:28 +0100)
committer
Chris
<mail@chriskamphuis.com>
Mon, 9 Feb 2015 15:28:25 +0000
(16:28 +0100)
ass2/chris/sws1-s4109503-s4202015/exercise1d.c
patch
|
blob
|
history
diff --git
a/ass2/chris/sws1-s4109503-s4202015/exercise1d.c
b/ass2/chris/sws1-s4109503-s4202015/exercise1d.c
index
9a3874d
..
0143950
100644
(file)
--- a/
ass2/chris/sws1-s4109503-s4202015/exercise1d.c
+++ b/
ass2/chris/sws1-s4109503-s4202015/exercise1d.c
@@
-1,13
+1,13
@@
#include<stdio.h>
#include<stdint.h>
-int main(){
- FILE *f
p
= fopen("/dev/urandom","r");
- uint16_t r
ead
= 0;
+int main(
void
){
+ FILE *f = fopen("/dev/urandom","r");
+ uint16_t r = 0;
do{
- fread(&r
ead, 2, 1, fp
);
- printf("%x
\n", read
);
- }while(r
ead
!= 42);
- fclose(f
p
);
+ fread(&r
, 2, 1, f
);
+ printf("%x
\n", r
);
+ }while(r != 42);
+ fclose(f);
return 0;
}