C++ Programming Language

Hello Friends,

In C++ Programming Language :

How can I declare a function that returns a pointer to a function of its own type?
1
2
3
4
class function{
public:
   function operator() (/*args*/);
};
As funny as your answer is, I don't believe that's quite what the OP is asking.

@ggicollegepunjab
Take a look here: http://www.newty.de/fpt/fpt.html

I believe what you're asking about is called a function pointer. They're nifty little things that all you to store a function that you want to call into a variable, and call that function later on. There is also plenty of other uses for them, but they're fun regardless.
I wasn't trying to be funny.

> to a function of its own type
that confuses me, and couldn't write the infinite recursive function prototype.
So decided to return an object instead.

However, I don't see the use case.
You've got a `select function' to select `select functions' ¿when will you do anything?
I could be wrong, but I believe the OP wanted to create a function that returned something that allowed other functions to be called. I don't know, these new members and not explaining themselves clearly confuses everyone.
Last edited on
Topic archived. No new replies allowed.