Let's say I have the following struct:
struct myStruct
{
int x;
int y;
int z;
int w;
};
I want to initialize this struct to a default value when calling the following function. If it helps I'm looking for a simple zero initialization.
void myFunc(myStruct param={0,0,0,0})
{
...
}
This code however gives me compile error. I've tried VS2003 and VS2008.
NOTE: I have looked at other answers mentioning the use of constructor. However I want the user to see what values I'm using for initialization.