function with optional arguments

Hey there,
I've been working on a button funktion to make inputs easier.
I want to have some optional configuration values, to get funktion calls smaller.
I found an example to do so in the forum archive to do so:

funktionType (dataType var, dataType var = defaultValue){
funktion
}
When I tried this arduino did not recognise the function any more. The error message was: "[functionName] was not declared in this scope.

The author of the original post said it worked for him, but I am really confused about the error message.

Can someone help me out?
Thank you

javamaster10000

Your example confuses me. For example, it uses 'var' twice. I also don't know what you mean by:

I want to have some optional configuration values, to get funktion calls smaller.

Please use code tags to copy and paste the actual code and the actual error messages.

Thanks!

javamaster10000:
I want to have some optional configuration values, to get funktion calls smaller.

Only the text gets shorter, the function will be called with the inserted default(s).

void withDefault(int aNumber = 10) {
  // ....
}

void someFunction() {
  withDefault();
  withDefault(10);
}

Uncompiled and untested example.

This compiled without error for me:

void withDefault(int aNumber = 10) {
  // ....
}
void setup() {}
void loop(){
  withDefault();
  withDefault(10);
}

Seems like you have it figured out.