Creating a linked list which contains string item

Hi everyone,

I'm a beginner in C++, currently learning about linked list.
If to store string type items into the linked list, as in one string as an item.
Is it possible to do so?
I was trying to implement it, but the errors popped out saying string does not name a type.
What does it means?

Thanks :)
To do this you take your linked list implementation and replace int, or whatever you implemented it for with string.
That error could be due to your forgetting to include <string> or use namespace std.
ummm yes hamsterman is right however if you want you can use STL container :
in header file <list> exist one class list . you can create obj of it and use of them for exm

list<string> l;
l.push_back( "..." );
l.pop_back();
Unless it's a specfic exercise -- to implement a linked list?

Is that the case?
oh, yeah, i forgot to include namespace std.
haha
thanks peeps! :)
Topic archived. No new replies allowed.