Remember to checkout the Codesnip below to review the C++ code yourself! Feel free to copy the code, but I ask that you please provide credit if you leave the code unchanged when you use it.
//Name: Nazmus //Program: Using #include<queue> in C++ //Website: EasyProgramming.net #include <iostream> #include <string> #include <queue> using namespace std; int main() { queue<string> students; string stuname; char quest; cout << "Do you want to enter data (Y/N)? "; cin >> quest; while (quest =='Y' || quest == 'y') { cout << "Please enter data for queue: "; cin >> stuname; students.push(stuname); cout << "Do you want to enter data (Y/N)? "; cin >> quest; } cout << endl; cout << students.back() << endl << endl; cout << students.size() << endl << endl; while (!students.empty()) { cout << students.front() << endl; students.pop(); } cin.ignore(); cin.get(); //system("pause"); }