View Single Post
Old Apr 26th, 2008, 3:00 PM   #5
peaceofpi
hi: for(;;) goto hi;
 
peaceofpi's Avatar
 
Join Date: Jun 2006
Posts: 86
Rep Power: 3 peaceofpi is on a distinguished road
Send a message via AIM to peaceofpi Send a message via MSN to peaceofpi
Re: Returning to the main function from another

Quote:
Originally Posted by Soulstorm View Post
You can't return whole functions in C++. You can return pointer to functions, but that is a whole different story.
Do I misunderstand you? 'Cause this works.

#include <cstdio>
int foo() { return 0; }
int bar() { return foo(); }
int main() { 
    printf("%d",bar());
    return bar();
}
__________________
How do you play Religious Roulette?
Stand around in a circle and blaspheme till someone gets struck by lightning.
peaceofpi is offline   Reply With Quote