Hi I am back I need am working on an unfinished project and cant get it to compile past line 44 , any help with why it wont do that would be great . I just am trying to get what I currently have to compile . my assignment , is a long way from complete, as I have to create an array that will allow the deletion and sorting of a product. I just am wanting to know what I am doing wrong currently is all. I also have comment lines in the program If someone could explain those to me that would be great. I emailed my instructor yesterday but no response yet. I hope you guys can help me some.

#include <cstdlib>
#include <iostream>
using namespace std;
void pause();// pause function prototype 
 int menu();// menu function prototype
 void add();// add function prototype
 void remove(); //remove function prototype
 void sort();//remove function prototype

int main()// main 
int cont =1;//what is cont i do not remember it is here and down further
             int choice = menu();
 switch (choice) // switch statement           
//cout<<choice<<endl;//switch here if choice is 1 do add 2 remove 3 sort 4exit
{ //open switch statement
    case 1: cout<<"\n\n";

    case 2: cout<< "\n";

    case 3: cout<< "\n\n";

    case 4: cout << "Invalid number, please enter a number"
              << " from the entrees above.\n\n";
    } //close switch statement

}while(cont==2);// can you explain what cont==2 does here please//open while

    return 0;
}//close while
void pause();//also explain what this does , pauses the screen i think
     cout<<"press enter to continue"<<endl;
     cin.ignore(80,'\n');// can you explain what this does here for me please

 int menu()// menu function
 {//open menu
     int c =-1;//this set the input to be greater than 1 correct?
     while(c<1||c>4)// this makes sure the loop is correct?
 {//open while
     system("cls");// clears the screen
     cout<<"1. Add\n"// places a menu on the screen
         <<"2. Delete\n"
         <<"3. Sort\n"
         cin>>c;//takes the user input and stores it as c

}//end while
return c;// returns the user input at c
}//end menu func
 void add()// add function
 {// open void function
 cout<<"add";//prints add on screen
 }//close void function
 void remove()// remove function
 {//open remove function
 cout<<"remove";// prints remove on screen
      }//close remove function
 void sort()// void function
 {//open sort function
  cout<<"sort";// prints sort on screen
      }//close sort function
3 Years
Discussion Span
Last Post by cobaltfive

line 44: remove the semicolon. As it is, it's just a function prototype.

line 46: ignore() removes one or more keys from the keyboard buffer.

When you come across a function that you don't know what it does you need to use google to find out about it.

Edited by Ancient Dragon


great thanks a lot . I did a bunch of google searches and came up with nothing before I came here, so thanks. that's awesome...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.