call function from function

Jan 2, 2012 at 11:30pm

lets say i have a function
i want to call anthor function(function2) from the original function (function1)
for example :
1
2
3
4
5
6
void function1()
{ // there is switch statement
switch(blah)
        case1: function2();// every time i do it he keep saying this function is not decleard !!!
           break;

Jan 2, 2012 at 11:49pm

Where have you written your second function?
Jan 3, 2012 at 12:26am
outside function 1 and i want to call it through function 1 ??
Jan 3, 2012 at 12:39am
Can you post your code for both functions please
Jan 3, 2012 at 1:15am
My guess is you have this situation:
1
2
3
4
5
6
7
8
9
10
11
function2(); // <-- Function 2 needs to be declared before it is used like this. Perhaps what you are missing?

function1()
{
    function2();
}

function2()
{
//All of function 2 is written in here...
}


Topic archived. No new replies allowed.