Skip to content

Instantly share code, notes, and snippets.

@BMuscle
Created November 10, 2019 06:24
Show Gist options
  • Select an option

  • Save BMuscle/9068cf334151f77ca613c4cf9e7718f1 to your computer and use it in GitHub Desktop.

Select an option

Save BMuscle/9068cf334151f77ca613c4cf9e7718f1 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
struct List {
int val;
struct List* next;
};
struct List* head;
void add(int val) {
struct List* list = head->next;
struct List* prev = head;
while (list != NULL) {
prev = list;
list = list->next;
}
struct List tmp;
tmp.val = val;
list->next = &tmp;
}
int main()
{
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment