|
@@ -162,9 +162,9 @@ Here `var2` is initialized to 5 and `var3` to 10.
|
162
|
162
|
|
163
|
163
|
**Examples of Invalid Function Headers:**
|
164
|
164
|
|
165
|
|
-1. `int example(int var1=1, float var2, int var3)` This header is invalid because the default values can only be assigned starting from the rightmost parameter.
|
|
165
|
+1. `int example(int var1 = 1, float var2, int var3)` This header is invalid because the default values can only be assigned starting from the rightmost parameter.
|
166
|
166
|
|
167
|
|
-2. `int example(int var1=1, float var2, int var3=10)` This header is invalid because you can't place parameters without values between other parameters with default values. In this case, `var2` doesn't have a default value but `var1` and `var3` do.
|
|
167
|
+2. `int example(int var1 = 1, float var2, int var3 = 10)` This header is invalid because you can't place parameters without values between other parameters with default values. In this case, `var2` doesn't have a default value but `var1` and `var3` do.
|
168
|
168
|
|
169
|
169
|
---
|
170
|
170
|
|