Quote Originally Posted by Shadowrun View Post
OK.... problem with arrays is already fixed with "std:copy". Most important question is...

Is possible to call a function (which needs 1 argument) wihtout any argument??
If you specify a default value for the function then you can call it without passing in an argument.

What I think you are looking for though here is a callback function, and there are differences between class member functions and standalone functions. If the callback requires a standalone function you cannot pass in a class member function (but you can pass in a static class member function, which is actually only a member by scoping and privelege reasons).

If the function requires a single parameter which is a void * pointer, which is common, then you can create a function like this:

Code:
return_type f( void * param )
{
   MyClass * myclassPtr = static_cast< MyClass * >( param );

   myclassPtr->memberFxn();
}
This is often what you need. If you need more data, eg MyClass and some other parameter information, then create a struct that has all that then use a function that casts the struct.

Use better names than above though in real code. Generally do not call your functions names like f.

Only use callbacks like this when working with third party APIs or if you are creating a C API. For C++ APIs that you are writing yourself, use polymorphism, either run-time or static (the latter when the class is known at compile time, and it generally means using templates). In C++0x there should hopefully be policy-based ways of doing it. (That also uses templates but gives better error messages if you use them wrong).