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:
6701ca4
)
updated ass1-1
author
Mart Lubbers
<mart@martlubbers.net>
Mon, 9 Feb 2015 15:22:25 +0000
(16:22 +0100)
committer
Mart Lubbers
<mart@martlubbers.net>
Mon, 9 Feb 2015 15:22:25 +0000
(16:22 +0100)
ass2/mart/sws1-s4109503-s4202015/exercise1b.c
patch
|
blob
|
history
ass2/mart/sws1-s4109503-s4202015/exercise1d.c
patch
|
blob
|
history
ass2/mart/sws1-s4109503-s4202015/exercise1d.txt
patch
|
blob
|
history
diff --git
a/ass2/mart/sws1-s4109503-s4202015/exercise1b.c
b/ass2/mart/sws1-s4109503-s4202015/exercise1b.c
index
c9473bd
..
53f11af
100644
(file)
--- a/
ass2/mart/sws1-s4109503-s4202015/exercise1b.c
+++ b/
ass2/mart/sws1-s4109503-s4202015/exercise1b.c
@@
-3,7
+3,7
@@
int main(void)
{
FILE *f = fopen("/dev/urandom", "r");
-
unsigned
char c;
+ char c;
do {
c = fgetc(f);
printf("%i %u %x\n", c, c, c);
diff --git
a/ass2/mart/sws1-s4109503-s4202015/exercise1d.c
b/ass2/mart/sws1-s4109503-s4202015/exercise1d.c
index
7555bc9
..
cca7449
100644
(file)
--- a/
ass2/mart/sws1-s4109503-s4202015/exercise1d.c
+++ b/
ass2/mart/sws1-s4109503-s4202015/exercise1d.c
@@
-4,9
+4,9
@@
int main(void)
{
FILE *f = fopen("/dev/urandom", "r");
- uint16_t c;
+ uint16_t c
= 0
;
do {
-
c = fscanf(f, SCNu16
);
+
fread(&c, 2, 1, f
);
printf("%04x\n", c);
} while(c != 42);
fclose(f);
diff --git
a/ass2/mart/sws1-s4109503-s4202015/exercise1d.txt
b/ass2/mart/sws1-s4109503-s4202015/exercise1d.txt
index
651c337
..
191111d
100644
(file)
--- a/
ass2/mart/sws1-s4109503-s4202015/exercise1d.txt
+++ b/
ass2/mart/sws1-s4109503-s4202015/exercise1d.txt
@@
-1,10
+1,10
@@
-271325
-40516
-65532
-23964
-41888
-95550
-234585
-50847
-85879
-87536
+6761
+74577
+128457
+60502
+10085
+166838
+3048
+132493
+22648
+28535