Function problem

Hi everyone,
I've been having problems with a program I wrote and I think it has something to do with the order the functions are in. It is basicly like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int function()
{
...
...
main();
return 0;
}

int main()
{
...
...
function();
return 0;
}

Can someone tell me if this is wrong and how I may correct the error?
It's not allowed to call main(). Pretending it's some other function foo() you will have to declare the function before you call it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
int foo();

int function()
{
...
...
foo();
return 0;
}

int foo()
{
...
...
function();
return 0;
}
Oh! Thanks a lot.
Topic archived. No new replies allowed.