I have been stumped by this problem, and its starting to get annyoing... Recently I asked my friend how can I have multiple sections on a Program.. So I gave it a try, I made two functions (I think you call it) Ones called
int secondmain()
thirdmain()
Note:Using Dev C++
So say I have a simple program,
#include <iostream>
usingnamespace std;
main()
{
int secondmain();
int thirdmain();
// efjeifjeie
system("PAUSE");
return 0;
}
secondmain()
{
// Code exists, but will not run this section
system("PAUSE");
return 0;
}
thirdmain()
{
// Code exists, but will not run this section
system("PAUSE");
return 0;
}
But all it does is run the first main... So any comments or help? Thanks_
Actually, the functions are being declared on lines 5 and 6. It's just that a) the function definitions don't have return types, and b) the functions themselves are never called.
#include <iostream>
usingnamespace std;
void secondmain();
void thirdmain();
int main() {
secondmain();
thirdmain();
system("PAUSE");
return 0;
}
void secondmain() {
// Code exists, but will not run this section
system("PAUSE");
}
void thirdmain() {
// Code exists, but will not run this section
system("PAUSE");
}