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
to find a number is even or not
18BCE2182 ASSESS_1 Q2-1
Sizeof void
CALCULADORA
Lab 9 v0.6
pruebapi2
Class #2, data types
Day Of The Programmer
example of scanf and basic integer manipulation
ele709 lab 3.2