I hope you can help me with a problem, i have a linked list and i need to insert a list of values inside every node of it, and i don't know how to do it,
Ok ... Thanks, but to do what you say Disch, it generates a huge mistake ... What happens is that the type of data (instead of int) is a structure to another class ... In fact, the program acts as a directory manager who in turn manage files, each file has the name and size as variables ...
Hahaha ... Do not worry ... I understand ... Really, I had not previously made errors of this type ... Thanks for the support ... I'll read the other comments and material on the subject ...
Hi,
I am giving you a source code in C how to insert node in a linked list
Step1. Create a Linked List.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# include <stdio.h>
# include <conio.h>
# include <alloc.h>
struct node
{
int data;
struct node *next;
} * start;
void create()
{
start=(struct node *) malloc (sizeof(structnode));
printf(" enter the data you want to insert:")
scanf("%d",&start->data);
start->next=NULL;
return;
}
this is how you have to create a linked list. Step 2. After creating linked list youn insert the data at
(a) Beginning
(b) End
(c) Middle.
enhance your c , c++ knowledge by reading some introduction to c++ books. http://www.wiziq.com/tutorial/762-C-Basic-Introduction