summaryrefslogtreecommitdiff
path: root/wk5/lect/list2.c
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-11 03:46:37 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-11 03:46:37 +0000
commit24bbbed75b994e4edd6997499738758a0f285677 (patch)
treeb79d99215bb13c666d1982e5e964df51e9c3792a /wk5/lect/list2.c
parent6473ab2343eadfe8625832a8c384995767f06980 (diff)
Wed, Apr 10, 2024, 8:46 PM -07:00
Diffstat (limited to 'wk5/lect/list2.c')
-rw-r--r--wk5/lect/list2.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/wk5/lect/list2.c b/wk5/lect/list2.c
new file mode 100644
index 0000000..7da5a5b
--- /dev/null
+++ b/wk5/lect/list2.c
@@ -0,0 +1,33 @@
+#include <cs50.h>
+#include <ctype.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+typedef struct node
+{
+ int number;
+ struct node *next;
+} node;
+
+int main(int argc, char *argv[])
+{
+ node *list = NULL;
+
+ for (int i = 1; i < argc; i++)
+ {
+ int number = atoi(argv[i]);
+
+ node *n = malloc(sizeof(node));
+ if (n == NULL)
+ {
+ // free memory
+ return 1;
+ }
+
+ n->number = number;
+ n->
+ }
+}