summaryrefslogtreecommitdiff
path: root/wk5/lect/temp.c
blob: b5f75c7603fd9c5403aa5aecfae8bedf05b7adbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#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(void)
{
    node *n = malloc(sizeof(node));
    n->number = 1;
    n->next = NULL;
    list = n;

    node *n = malloc(sizeof(node));
    n->number = 2;
    n->next = list;
    list = n;

    // This creates a linked list where 2 points to 1
}