Write your question here.
Hi
I have program have many functions I want if the first functions valid call the second function if the second function valid call the thierd
Here is another simple program to demonstrate what youre saying so hopefully it will make it easier to understand. It shows you how to function calls the next function and so on and so forth but also how the program returns through those same functions back to main.
#include <iostream>
#include <string>
void thirdFunc()
{
std::cout << "This is the third and final function." << std::endl;
std::cout << "Leaving Third Function." << std::endl;
return;
}
void secondFunc()
{
std::cout << "This is the second function." << std::endl;
std::cout << "Calling third function." << std::endl;
thirdFunc();
std::cout << "Back in the second function." << std::endl;
return;
}
void firstFunc()
{
std::cout << "This is the first function." << std::endl;
std::cout << "Calling Second function now." << std::endl;
secondFunc();
std::cout << "Back in the first function." << std::endl;
return;
}
int main()
{
firstFunc();
std::cout << "Inside Main" << std::endl;
}