-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated version of stack linked list #2036
Conversation
updated version of stack linked list with proper formatting and fixed print statements.
This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Looks like we might need to use smart pointers instead. |
int main() | ||
{ | ||
int ch = 0, x = 0; | ||
do { | ||
do | ||
{ | ||
std::cout << "\n0. Exit or Ctrl+C"; | ||
std::cout << "\n1. Push"; | ||
std::cout << "\n2. Pop"; | ||
std::cout << "\n3. Print"; | ||
std::cout << "\nEnter Your Choice: "; | ||
std::cin >> ch; | ||
switch (ch) { | ||
case 0: | ||
break; | ||
case 1: | ||
std::cout << "\nInsert : "; | ||
std::cin >> x; | ||
push(x); | ||
break; | ||
case 2: | ||
pop(); | ||
break; | ||
case 3: | ||
show(); | ||
break; | ||
default: | ||
std::cout << "Invalid option!\n"; | ||
break; | ||
switch (ch) | ||
{ | ||
case 0: | ||
break; | ||
case 1: | ||
std::cout << "\nInsert : "; | ||
std::cin >> x; | ||
push(x); | ||
break; | ||
case 2: | ||
pop(); | ||
break; | ||
case 3: | ||
show(); | ||
break; | ||
default: | ||
std::cout << "Invalid option!\n"; | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use tests
closing due to no response from author, please comment if you'd like this to be re opened |
updated version of stack linked list with proper formatting and fixed print statements.
Description of Change
Checklist
Notes: