A have function with prototype:
void arryprnt(int[], string, int, string, string);
And the definition:
void arryprnt(int[] a, string intro, int len, string sep=", ", string end=".") {
}
And I call it this way:
arryprnt(jimmy, "PSEUDOJIMMY: ", 15);
... when I make this call to arryprnt, I get a compiler error saying that I used too few arguments based on what the prototype says. βGood,β I thought, βthe compiler does not know that some arryprnt parameters have default values. I just copy the parameters from the definition to the prototype.β And I did, however, I got a compiler error telling me that I was calling arryprnt with too many arguments! I can just specify all the arguments, but is there a way to call it without specifying all the arguments?
source
share