Can a function return a pointer to itself or another function of the same type (same arguments and return value)?
Logically, there should be nothing preventing it. However, syntactically, I can't think of a way to do this.
Can a function return a pointer to itself or another function of the same type (same arguments and return value)?
Logically, there should be nothing preventing it. However, syntactically, I can't think of a way to do this.
I can think of returning the function pointer as a void pointer but I don't see how it would be useful.
I thought of that. Surely there is a more direct aproach though.
The point of this is to have a process queue, where each function is executed then gets put on the queue. When a certain function is called, the queue is restarted to a certian point, meaning that the program starts reading from that point. Essentially, the point is to create a custom while loop that does not require a closing brace.
http://c-faq.com/decl/recurfuncp.htmlOriginally Posted by King Mir
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Thank you!