Results 1 to 2 of 2

Thread: Function Prototype Error

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    68
    __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

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    All optional arguments must occur at the END of the argument list. And they must be called in order, for example:
    Code:
    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.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width