From: Mart Lubbers Date: Sun, 8 Feb 2015 19:08:21 +0000 (+0100) Subject: unfinished 2 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=a56d49c6d5197db1fa091237d5199b9441364b3a;p=sws1-1415.git unfinished 2 --- diff --git a/ass2/mart/sws1-s4109503-s4202015/Makefile b/ass2/mart/sws1-s4109503-s4202015/Makefile index 1b465c7..5802a0e 100644 --- a/ass2/mart/sws1-s4109503-s4202015/Makefile +++ b/ass2/mart/sws1-s4109503-s4202015/Makefile @@ -1,11 +1,14 @@ CC=gcc CFLAGS=-std=c99 -Wall -Wextra -all: exercise1 +all: exercise1 exercise2 + +exercise2: exercise2.c + $(CC) $(CFLAGS) -O3 exercise2.c -o exercise2 exercise1: exercise1b.c exercise1d.c $(CC) $(CFLAGS) exercise1b.c -o exercise1b $(CC) $(CFLAGS) exercise1d.c -o exercise1d clean: - $(RM) exercise1b exercise1d + $(RM) exercise1b exercise1d exercise2 diff --git a/ass2/mart/sws1-s4109503-s4202015/exercise1b b/ass2/mart/sws1-s4109503-s4202015/exercise1b new file mode 100755 index 0000000..663e25a Binary files /dev/null and b/ass2/mart/sws1-s4109503-s4202015/exercise1b differ diff --git a/ass2/mart/sws1-s4109503-s4202015/exercise1d b/ass2/mart/sws1-s4109503-s4202015/exercise1d new file mode 100755 index 0000000..89a79b9 Binary files /dev/null and b/ass2/mart/sws1-s4109503-s4202015/exercise1d differ diff --git a/ass2/mart/sws1-s4109503-s4202015/exercise2 b/ass2/mart/sws1-s4109503-s4202015/exercise2 new file mode 100755 index 0000000..fda7b35 Binary files /dev/null and b/ass2/mart/sws1-s4109503-s4202015/exercise2 differ diff --git a/ass2/mart/sws1-s4109503-s4202015/exercise2.c b/ass2/mart/sws1-s4109503-s4202015/exercise2.c index 6ea6252..c05c0ed 100644 --- a/ass2/mart/sws1-s4109503-s4202015/exercise2.c +++ b/ass2/mart/sws1-s4109503-s4202015/exercise2.c @@ -1,4 +1,27 @@ +#include +#include + +void print(char *address, unsigned int size) +{ + printf("address: %p, size: %u, psize: %u\n", address, size, sizeof(address)); + for(unsigned char i=0; i