nog korter ex2
[sws1-1415.git] / ass4 / mart / sws1-assignment4-s4109503-s4202015 / exercise2.c
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <string.h>
4
5 void heap_attack(void)
6 {
7 char *b = malloc(1);
8 while(memcmp(--b, "4109503", 8) != 0);
9 b += 7;
10 while(memcmp(b, "4202015", 8) != 0)
11 *b++ = ' ';
12 }
13
14 int main(void)
15 {
16 char *s1 = malloc(8);
17 if(s1 == NULL)
18 return -1;
19 char *s2 = malloc(8);
20 if(s2 == NULL)
21 return -1;
22 strcpy(s1, "4109503");
23 strcpy(s2, "4202015");
24 heap_attack();
25 printf("student 1: \"%s\"\n", s1);
26 printf("student 2: \"%s\"\n", s2);
27 return 0;
28 }