I found 'double linked list' with using 'class'
but... can i successfully compile program without using 'class'?
If possible, can you show me some examples?
The STL list is implemented as a doubly linked list. Just #include<list> and remember that it is under the std namespace so either "using namespace std;" or prefix it with "std::". Was that your question? What does your code look like?
Yeah..Thank you May be this could be help.
I didn't make my code. I have to make my codes doubly linked list without using class just using pointers. And I don't know well where should i start.
Define a node with a structure then create the list that retains a pointer to the first and last nodes or null. Your operations (add, find, delete etc.) are defined on the list structure, you can prefix your functions with the letter L (from list) and the first argument to be a pointer to your list, like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
struct List
{
List* first;
List* last;
};
void LCreate(List* list)
{
list = new List;
list->first = list->last = 0;
}
void LDestroy(List* list)
{
delete list;
}