optional arguments in vc++

I want to use optional argument to call a member function in vc++ .. can anyone specify how could i go and implement in vc
thanks in advance..
[151 byte] By [vcanu] at [2007-11-17 15:47:39]
# 1 Re: optional arguments in vc++
Hi,
To use Optional Parameters, you must define some default value for the optional parameter, so that, when no value is supplied, compiler will use the default value to to call the function. You can declare a function with optional parameters like this.
//Definition in class MyClass
void MyFunctionMember(int Param1, int OptParam2=0, char OptString="Mansukh");

//Atual implemetation
void MyClass::MyFunctionMember(int Param1, int OptParam2, char OptString)
{
//Your Code
}

But remember,
While dealing with more than one optional parameters, it should be considered that, optional parameters should be used from right to left. You can't assign a function with a non optional parameter in right place of a optional parameter.

//This will be invalid
void MyFunctionMember(int Param1, int OptParam2=0, char OptString="Mansukh", int NoOptParam);
Mansukh Patidar at 2007-11-10 8:12:37 >