C ++ map nested queue pointer, queue nested struct pointer instance, map instance
# Include
# Include
# Include
# Include
# Include
// # Include
Usingnamespacestd;
Queue queue1;
/* Queue * queue2 ;*/
// Queue2 = (queue *) malloc (sizeof (queue ));
For (inti = 0; I <10; I ++ ){
RevDatarecvD;
RecvD. size = I;
Strcpy (recvD. data, "hello ");
RevData * recvp = (RevData *) malloc (sizeof (RevData ));
Memcpy (recvp, & recvD, sizeof (RevData ));
Queue1.push (recvp); // recvp );
// Queue1.push (& recvD );
}
Map *> imap;
Map *> * queue2;
// Queue2 = (queue *) malloc (sizeof (queue ));
For (inti = 0; I <1; I ++ ){
Imap [I] = & queue1; // recvp );
// Imap [I] = & recvD;
}
Queue2 = & imap;
For (inti = 0; I <1; I ++ ){
Queue * recv = (* queue2) [I];
For (intj = 0; j <10; j ++ ){
RevData * recvd = recv-> front ();
Cout <
Cout <
Intlenga = recv-> size ();
Recv-> pop ();
}
}