• Advertisement

Archived

This topic is now archived and is closed to further replies.

Trivial facts

This topic is 5210 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Did you know you can use main as a recursive function ? void (*pMain)() = main; //great for stack overflows....lol Q: What is the smallest data type that can be used? A: ONE single bit (read up on bit field structs ) Q: How would you prototype this? A function that takes a pointer to a pointer to an int and returns a pointer to an array of 5 pointers to functions that take an array of const chars and return an int. *forgot to mention this in first post ANSWER IS BELOW ( dont want to spoil any ones attempt) a: int (*(*foo(int **))[5])(const char []); [edited by - pointer_to_main on November 18, 2003 6:07:47 AM]

Share this post


Link to post
Share on other sites
Advertisement
masochist..

say... what about this


typedef int (*ptFooFunc)(const char *arrychar);
typedef ptFooFunc[5] ptFuncArry;

ptFuncArry* foobar(int **num);






--{You fight like a dairy farmer!}

Share this post


Link to post
Share on other sites
Actually, you're officially not allowed to use main like that, although a lot of compilers support it; see section 3.6.1.3 of the C++ standard.. It's pretty much useless anyway.

[edited by - sneftel on November 18, 2003 4:12:00 PM]

Share this post


Link to post
Share on other sites

  • Advertisement