Having trouble compiling

I can't address the problem. I having trouble compiling the coding. Anyone can help me please. Thank you so much

#include <iostream>
using namespace std;

void show_addstudentrecord();

void show_viewreport();

void give_help();

int main()

{
int choice;

do
{
cout<<endl;
cout<<"Choose 1 to Add Student record.\n";
cout<<"Choose 2 to View Report.\n";
cout<<"Choose 3 to display Help.\n";
cout<<"Choose 4 to Exit the program.\n";
cin>>choice;

switch(choice)
{
case 1:
show_addstudentrecord();
break;
case 2:
show_viewreport();
break;
case 3:
give_help();
break;
case 4:
cout<<"End of program.\n";
break;
default:
cout<<"Not a valid choice.\n";
cout<<"Choose again.\n";
}
}while (choice != 4);
return 0;
}
Last edited on
Use code tags, the button with <> on the right. It would make the code nicer. You should also write what the error is.
Your problem is the statement after while: }while (choice 1=4); should be
}while (choice !=4);. You forgot to press the shift key
undefined reference to `show_addstudentrecord()'
undefined reference to `show_viewreport()'
undefined reference to `give_help()'

this is the error shown when i try to compile it.
You did not define the functions. You can define the functions on initialization:
1
2
3
void a_function(){
  std::cout<<"wow!\n";
}


or forward declare it:
1
2
3
4
5
6
7
8
9
void a_function();

int main(){
  a_function();
}
void a_function(){
  std::cout<<"wow!\n";
}


Also, I have a problem with the forum where the <> button sometimes does not work, and you have to type the tags manually, like [ code ] [ /code ] (<- remove the space padding).
alright dude. I got it. it's working. thank you so much for your help.
Topic archived. No new replies allowed.