suppose I got a node like this:
struct node{
int a;
int b;
}
Now I want to make a queue structure in cpp. If the data type was int then we could do that easily in this way:
queue<int> a;
And we could also push or pop elements like this: a. push_back(12) or a. pop(12)
But in the earlier case when out data type is user defined how can we make such a queue and push or pop elemeqnts from it?
std::queue<node>
as you like. (Didn't dv BTW) – πάντα ῥεῖ Sep 11 '16 at 9:13int
withnode
. Have you even tried it? – Martin Nyolt Sep 11 '16 at 9:15node
and then push it. – max_hassen Sep 11 '16 at 9:21a.push_back(node{11,12})
maybe? – πάντα ῥεῖ Sep 11 '16 at 9:24