diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-10 22:10:33 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-10 22:10:33 +0000 |
commit | e2df2f4310f68d0f37197874c24afc0c693f0891 (patch) | |
tree | cdb03cd6321f4eb391a52aa0c9fb83ac248f4fa4 /wk5 | |
parent | 25e0a8d0aaa262859ac49c21a804fadce3da5606 (diff) |
Wed, Apr 10, 2024, 3:10 PM -07:00
Diffstat (limited to 'wk5')
-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; |