0
Where is the error
4 odpowiedzi
+ 2
Default values can only be placed on latter parameters, e.g. func(int a, int b = 42).
You don't have data type for the second parameter.
To print 2 strings, use cout << string1 << string2;
+ 2
zaya1235
CarrieForle just said, "default values can only be placed on latter parameters".
Example: func(int a, int b = 1) is valid, but func(int b = 1, int a) is invalid
For the same reason, you code is invalid.
void printOrder(string hisOrder, string my="Black tea") is valid, but your function definition is invalid.
0
CarrieForle so it should be like this
void printOrder(string my="Black tea", string hisOrder ) {
cout << my << hisOrder ;
}
0
CarrieForle XXX thank you👁️💋👁️