fork download
  1. #include <iostream>
  2.  
  3. using std::cout;
  4. using std::cin;
  5. using std::endl;
  6.  
  7. void addConnection(void* graph)
  8. {
  9. }
  10.  
  11. void deleteConnection(void* graph)
  12. {
  13. }
  14.  
  15. void showConnection(void* graph)
  16. {
  17. }
  18.  
  19. void showMatrix(void* graph)
  20. {
  21. }
  22.  
  23. int main()
  24. {
  25. void* graph = nullptr;
  26. bool run = true;
  27. while (run == true)
  28. {
  29. int menuChoice;
  30. cout << "Welcome to the menu" << endl;
  31. cout << "Pick one of the following" << endl;
  32. cout << "1. add connection" << endl;
  33. cout << "2. delete connection " << endl;
  34. cout << "3. show total number of connections " << endl;
  35. cout << "4. show matrix " << endl;
  36. cout << " 5. to exit" << endl;
  37. cout << "Selection : ";
  38. cin >> menuChoice;
  39. switch (menuChoice)
  40. {
  41. case 1: addConnection(graph);
  42. break;
  43. case 2: deleteConnection(graph);
  44. break;
  45. case 3: showConnection(graph);
  46. break;
  47. case 4: showMatrix(graph);
  48. break;
  49. /*case 5:
  50.   cout << "Exiting ...\n";
  51.   run = false;
  52.   break;*/
  53. default:
  54. cout << "Improper input " << endl; // for some reason this flies into infinite when a character is entered.
  55. cout << "Exiting ...\n";
  56. run = false;
  57. break;
  58.  
  59. }
  60. }
  61. }
Success #stdin #stdout 0s 3420KB
stdin
1
2
3
q
stdout
Welcome to the menu
Pick one of the following
1. add connection
2. delete connection 
3. show total number of connections 
4. show matrix 
 5. to exit
Selection : Welcome to the menu
Pick one of the following
1. add connection
2. delete connection 
3. show total number of connections 
4. show matrix 
 5. to exit
Selection : Welcome to the menu
Pick one of the following
1. add connection
2. delete connection 
3. show total number of connections 
4. show matrix 
 5. to exit
Selection : Welcome to the menu
Pick one of the following
1. add connection
2. delete connection 
3. show total number of connections 
4. show matrix 
 5. to exit
Selection : Improper input 
Exiting ...