View Single Post
Old Apr 26th, 2008, 7:07 PM   #8
Benoit
Expert Programmer
 
Benoit's Avatar
 
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 548
Rep Power: 4 Benoit is on a distinguished road
Re: Returning to the main function from another

Quote:
Originally Posted by peaceofpi View Post
Do I misunderstand you? 'Cause this works.

#include <cstdio>
int foo() { return 0; }
int bar() { return foo(); }
int main() { 
    printf("%d",bar());
    return bar();
}
In that code snipper, an integer value is being returned. I think Soulstorm was referring to returning a chunk of data that can be executed somehow.
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4
Benoit is offline   Reply With Quote