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
18BCE2182 ASSESS_1 Q1-5
3D NO SE XD
C code to compare two texts in form of array of chars ignoring the capitalization
WrongWay reversible iterator Copyright(C) 2016 Henry Kroll III www.thenerdshow.com
gcc compiler code for delay
MyWall1
NO OF NODES IN LINK LIST
A.c
LinkedListTest
X=1