I need a few helps for some things that I just cannot get the syntax of! (I need these, and if you don't believe me I can post the reason)
1) Creating a function within a function
2) Creating a class within a function
3) Declaring a template function outside a class
EXAMPLES:
1)
typedef void(*FUNC)();
FUNC GenFunc()
{
FUNC ret=;//HELP! I NEED TO MAKE A FUNCTION
return ret;
}
2)
class Abstract
{
public:
virtual void do()=0;
}
Abstract &getClass()
{
Abstract &ret=;//HELP! I NEED TO MAKE A CLASS DERIVED FROM Abstract
return ret;
}
3)
class Thing
{
public:
template <typename T>
T thingy();
}
//NOW WHAT? HOW DO I WRITE THE CODE OF thingy?!
Answers to any of these questions would be greatly appreciated, thanks!