Reffer to a other function

Hey all how can i reffer from main to submain

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>

using namespace std;

int main ()
{
 // Does some stuff 
// needs to call submain
}
int submain ()
{
 // Does some stuff
}
You need to forward declare submain, so it becomes visible inside main:
1
2
3
4
5
6
7
8
9
10
11
int submain (); // forward declaration

int main ()
{
 // Does some stuff 
// needs to call submain
}
int submain ()
{
 // Does some stuff
}

But how do i call Submian from main if i debug this it will only play main ?
1
2
3
4
int main ()
{
    submain(); // call submain
}

Topic archived. No new replies allowed.