i'm writing a basic linked list program, prompting to enter (among a lot of things) a description. everything is coming out right but somehow the description is getting lost before it can be outputted. i know i'm making a basic error here, so i'm hoping someone can tell me what i'm doing wrong. here's my code, edited for the description part:
Code:
struct
{
char descrip[25];
node* next;
};
void InsertDescrip(char [] );
node* head=NULL;
int main()
{
char des[25];
node* current=NULL;
cout<<"Enter description: "<<endl;
cin>>des;
current= new node;
InsertDescrip(des);
head=current;
cout<<"Press any key to terminate"<<endl;
getch();
}
void InsertDescrip(char des[25] )
{
current->descrip[25]=des[25];
current->next=head;
}