repositories
/
sws1-1415.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
545dd2ab7ebfef8bfc033125ef8f0bfd00aa6f72
[sws1-1415.git]
/
ass2
/
chris
/
sws1-s4109503-s4202015
/
exercise1d.c
1
#include<stdio.h>
2
#include<stdint.h>
3
4
int
main
(){
5
FILE
*
fp
=
fopen
(
"/dev/urandom"
,
"r"
);
6
unsigned char
buffer
[
2
];
7
uint16_t
read
=
0
;
8
do
{
9
fread
(
buffer
,
2
,
1
,
fp
);
10
read
=
256
*
buffer
[
0
] +
buffer
[
1
];
11
printf
(
"%x
\n
"
,
read
);
12
}
while
(
read
!=
42
);
13
fclose
(
fp
);
14
return
0
;
15
}