Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Linked List
//Title of this code //gcc 4.9.2 #include<stdlib.h> #include<stdio.h> #include<string.h> typedef struct cell cell; struct cell{ char*key; cell*next; }; void insert_list(char*key,cell**list){ if(*list==NULL){ *list=(cell*)malloc(sizeof(cell)); (*list)->key=(char*)malloc(sizeof(char)*(strlen(key)+1)); strcpy((*list)->key,key); (*list)->next=NULL; } else if(strcmp(key,(*list)->key)) insert_list(key, &((*list)->next)); } void print(cell*list){ if(list!=NULL){printf("%s\t",list->key);print(list->next);} } int main(){ cell*list=NULL; insert_list("Kevin",&list); insert_list("Parfait",&list); insert_list("Ahmet",&list); print(list); return 0; }
run
|
edit
|
history
|
help
0
Lab 9 v0.8
Project 5 v0.1
Simple Fork
AVANCE PREGUNTA 10 DE CADENAS
C_141204_ContadorPalabras
etapa final de pregunta 2
swap_talent.c
18BCE2182 ASSESS_1 Q2-1
C(gcc) Local Time and math.h Example
150108_RecursividadFibonacci