I think making it work in C would also require a return statement, or just
void functions:
Code:
void function2(int aArg)
{
//...
}
void function1(int aArg)
{
//...
function2(aArg);
}
int main()
{
//...
int control;
function1(control);
}
C isn't designed well for that because while
function2 is running, the items on the stack belonging to
function1 and
main are still there, even though you don't intend to use them again.
ta0kira
Edit: You can overcome the stack problem like this:
Code:
void function1(int aArg)
{
{
//...
}
function2(aArg);
}
There will be an argument left on the stack for each time control is passed, but at least that's uniform and predictable.
PS I just learned this in response to your question, so I may have misinterpreted the concept.