Add value to dynamic queue

At first,I like to say sorry about my bad English
I want to know how I can add values ​​to the queue using structures in this form


1
2
3
4
5
6
7
8
9
10
struct Que
{
    struct
    {
        int data;
        Que *next;
    };
    Que *head;
    Que *tail ;
};


Anyone can explain it to me I would be grateful


I want to know how I can add values ​​to the queue using structures in this form


By writing some code?

There's not really enough information given here.
What are the rules for adding values?
Can there be duplicates?
Are the values ordered?
It's not clear if you're tring to implement a linked list or a tree of some sort?
When are nodes linked to next verses when are they linked to head or tail?
What are the rules for adding values?
There is no rule. Accept any value

Can there be duplicates?
yes

Are the values ordered?
no

It's not clear if you're tring to implement a linked list or a tree of some sort?
As linked list

when are they linked to head or tail?
As I know first node link with head
last node link with tail


If it's a list, why not just use the C++ list container?
http://www.cplusplus.com/reference/stl/list/

1
2
3
list<int>  my_list;
int some_value = 42;
my_list.push_back (some_value);


Topic archived. No new replies allowed.