-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueue.cpp
More file actions
33 lines (28 loc) · 714 Bytes
/
Queue.cpp
File metadata and controls
33 lines (28 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
//
#include <iostream>
#include "Queue.h"
void Queue::queuePush() {
std::string str;//input info
std::cout << "Record your entry: ";
std::cin.ignore();//delete new line buffer
std::getline(std::cin, str);//use getline to store multiple words into 'str' instead of one
q.push(str);
}
void Queue::isEmpty() {
if(q.empty()){
std::cout << "Forum empty! Prompt the discussion!";
}else{
std::cout << "Forum is not empty.";
}
}
void Queue::selection() {
}
void Queue::queuePrint() {
std::queue <std::string> q2; //temp queue to store original queue values
q2 = q;
while(!q2.empty()){
std::cout << q2.front() << "\n\n";
q2.pop();
}
}