classes with optional parameters

  • Thread starter Thread starter Guest
  • Start date Start date
You must specify the default value in the function (constructor) prototype
defined in the header file, e.g.

// In header file:
...
int DoSomething(int nRequired, int nOptional = 0);
...

// In source file:
int MyClass::DoSomething(int nRequired, int nOptional)
{
...
}

All optional parameters must be at the end.

Alek
 
Back
Top