PDA

Click to See Complete Forum and Search --> : Function Prototype Error


Stockton.S
Jan 9th, 2001, 12:21 PM
__fastcall TScanWindow(TComponent* Owner, AnsiString ATitle,
MsgsArrayType *APlot, short ASensor, ConfigType *AConfig,
short AClearanceLevel, char *AFileName, float AMinTemp,
long ASerialNumber = 0, char *ADrive, char *APath, char Master = ' ');

The compiler asks me for DEFAULT VALUES for *ADrive and *APath any idea why this is?

Thanks for your help

Simon

parksie
Jan 9th, 2001, 12:24 PM
All optional arguments must occur at the END of the argument list. And they must be called in order, for example:

void func(int x = 0; int y = 5; int z = 23);

func(5); // calls func(5,5,23);
func(5,3);//calls func(5,3,23);

So you couldn't supply only x and z.