void func ( string word = \"hello\", int b ) {
// some jobs
}
in another function
//calling
func ( \"\", 10 ) ;
When I have compiled it, compi
Parameters with default values have to come at the end of the list because, when calling the function, you can leave arguments off the end, but can't miss them out in the middle.
Since your arguments have different types, you can get the same effect using an overload:
void func ( string word, int b ) {
// some jobs
}
void func ( int b ) { func("hello", b); }