void func ( string word = \"hello\", int b ) {
// some jobs
}
in another function
//calling
func ( \"\", 10 ) ;
When I have compiled it, compi
The error message is proper. If the default argument is assigned to a given parameter then all subsequent parameters should have a default argument. You can fix it in 2 ways;
(1) change the order of the argument:
void func (int b, string word = "hello");
(2) Assign a default value to b
:
void func (string word = "hello", int b = 0);