diff options
Diffstat (limited to 'wk5/lect/list.c')
-rw-r--r-- | wk5/lect/list.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/wk5/lect/list.c b/wk5/lect/list.c index a9a96ed..42268c7 100644 --- a/wk5/lect/list.c +++ b/wk5/lect/list.c @@ -1,14 +1,13 @@ -#include <cs50.h> -#include <ctype.h> -#include <stdint.h> #include <stdio.h> #include <stdlib.h> -#include <string.h> -#include <math.h> int main(void) { - int list[3]; + int *list = malloc(3 * sizeof(int)); + if (list == NULL) + { + return 1; + } list[0] = 1; list[1] = 2; |