Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How do I return a function from a function in C++?

1 Answer

Relevance
  • 9 years ago
    Favorite Answer

    return a pointer to it

    int foo()

    {

    }

    int main()

    {

    int (*pFoo)() = foo; // pFoo points to function foo()

    return pFoo; // return the address of the function foo

    }

Still have questions? Get your answers by asking now.