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:
a37ad6c
)
update ass1-ex1
author
Mart Lubbers
<mart@martlubbers.net>
Sun, 8 Feb 2015 17:33:11 +0000
(18:33 +0100)
committer
Mart Lubbers
<mart@martlubbers.net>
Sun, 8 Feb 2015 17:33:11 +0000
(18:33 +0100)
ass2/mart/sws1-s4109503-s4202015/Makefile
patch
|
blob
|
history
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/exercise2.c
[new file with mode: 0644]
patch
|
blob
diff --git
a/ass2/mart/sws1-s4109503-s4202015/Makefile
b/ass2/mart/sws1-s4109503-s4202015/Makefile
index
cacd2e7
..
1b465c7
100644
(file)
--- a/
ass2/mart/sws1-s4109503-s4202015/Makefile
+++ b/
ass2/mart/sws1-s4109503-s4202015/Makefile
@@
-1,7
+1,9
@@
CC=gcc
CFLAGS=-std=c99 -Wall -Wextra
CC=gcc
CFLAGS=-std=c99 -Wall -Wextra
-all: exercise1b.c exercise1d.c
+all: exercise1
+
+exercise1: exercise1b.c exercise1d.c
$(CC) $(CFLAGS) exercise1b.c -o exercise1b
$(CC) $(CFLAGS) exercise1d.c -o exercise1d
$(CC) $(CFLAGS) exercise1b.c -o exercise1b
$(CC) $(CFLAGS) exercise1d.c -o exercise1d
diff --git
a/ass2/mart/sws1-s4109503-s4202015/exercise1b.c
b/ass2/mart/sws1-s4109503-s4202015/exercise1b.c
index
9cbaa94
..
1f8a43e
100644
(file)
--- a/
ass2/mart/sws1-s4109503-s4202015/exercise1b.c
+++ b/
ass2/mart/sws1-s4109503-s4202015/exercise1b.c
@@
-1,7
+1,7
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
-int main()
+int main(
void
)
{
FILE *f = fopen("/dev/urandom", "r");
char c;
{
FILE *f = fopen("/dev/urandom", "r");
char c;
@@
-9,7
+9,6
@@
int main()
c = fgetc(f);
printf("%i %u %x\n", c, c, c);
} while(c != 42);
c = fgetc(f);
printf("%i %u %x\n", c, c, c);
} while(c != 42);
- if(f != stdin)
- fclose(f);
+ fclose(f);
return 0;
}
return 0;
}
diff --git
a/ass2/mart/sws1-s4109503-s4202015/exercise1d.c
b/ass2/mart/sws1-s4109503-s4202015/exercise1d.c
index
4b6e9c7
..
07dfa41
100644
(file)
--- a/
ass2/mart/sws1-s4109503-s4202015/exercise1d.c
+++ b/
ass2/mart/sws1-s4109503-s4202015/exercise1d.c
@@
-2,7
+2,7
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
-int main()
+int main(
void
)
{
FILE *f = fopen("/dev/urandom", "r");
uint16_t c;
{
FILE *f = fopen("/dev/urandom", "r");
uint16_t c;
@@
-10,7
+10,6
@@
int main()
c = fgetc(f)+fgetc(f)*256;
printf("%04x\n", c);
} while(c != 42);
c = fgetc(f)+fgetc(f)*256;
printf("%04x\n", c);
} while(c != 42);
- if(f != stdin)
- fclose(f);
+ fclose(f);
return 0;
}
return 0;
}
diff --git a/ass2/mart/sws1-s4109503-s4202015/exercise2.c
b/ass2/mart/sws1-s4109503-s4202015/exercise2.c
new file mode 100644
(file)
index 0000000..
6ea6252
--- /dev/null
+++ b/
ass2/mart/sws1-s4109503-s4202015/exercise2.c
@@ -0,0
+1,4
@@
+int main(void)
+{
+
+}