नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'class::member' : missing default parameter for parameter parameter
Remarks
The default parameter list is missing a parameter. If you supply a default parameter anywhere in a parameter list, you must define default parameters for all subsequent parameters in the current declaration or any previous declarations within the same scope.
Example
The following example generates C2548 for:
func1because it's missing the default argumentb.func3because it's missing the default argumentc.
The following example doesn't generate C2548 for:
func2because all the required default arguments are supplied.- The second
func4declaration because the default argumentcis supplied in the preceding declaration and is in the same scope. - The third
func4declaration because both default argumentsbandcare provided previously.
// C2548.cpp
// compile with: /c
void func1(int a = 1, int b, int c = 3); // C2548
void func2(int a = 1, int b = 2, int c = 3); // OK
void func3(int a, int b = 2, int c); // C2548
void func4(int a, int b, int c = 3); // OK
void func4(int a, int b = 2, int c); // OK
void func4(int a = 1, int b, int c); // OK