Hi,
When I try to insert a name into my linked list I get output that looks something like: ==============&=== and I don't know why.
Here is a simple version of my code which is causing my problems:
Any reasons why this is happening?Code:#include <iostream.h> struct node { char name[20]; node *next; }; int main() { node * L= new node; char newname[20]; cout<<"Enter a name:"<<endl; cin >> newname; L->name[20] = newname[20]; cout<<L->name; return(0); }
Thanks in advance