Is it possible to call a void function from another void function?

will this work?

 int input;
	cout<<"\t\t  Main Menu \n\n";
	cout<<"\t\t 1. Student Details \n";
	cout<<"\t\t 2. Payment Details \n";
	cout<<"\t\t 3.Exit \n\n";
	cout<<"\t\t Select 1/2/3 : ";

	   void studentDetails();
	   void printPaidStudents();
	   return -1;


i wrote the voide studentDetails function too...
but the output is not there...
wats wrong in this?

You're trying to declare functions in mainMenu, not calling them. You don't need to declare the type while calling it.

void mainMenu()
void studentDetails();

Add red void. Function header needs the return type.
Delete green void. Function calls DO NOT need the return type.

MosaicFuneral beat me to it!
Edit : So did Majestics.

i removed the void infront of the function. but now a compilation error came mentioning the function should have a prototype

you have to declare functions before using them,,

return type  function name (parameters list)

in your case

void studentDetails();

and call them


Because you forgot to declare it outside before hand, such as in a header or where-ever.

yea. thanx for da help.

This article has been dead for over six months. Start a new discussion instead.