नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'identifier' : function must return a value
Remarks
The function was declared as returning a value, but the function definition does not contain a return statement.
This error can be caused by an incorrect function prototype:
If the function does not return a value, declare the function with return type void.
Check that all possible branches of the function return a value of the type declared in the prototype.
C++ functions containing inline assembly routines that store the return value in the
AXregister may need a return statement. Copy the value inAXto a temporary variable and return that variable from the function.
Example
The following example generates C2561:
// C2561.cpp
int Test(int x) {
if (x) {
return; // C2561
// try the following line instead
// return 1;
}
return 0;
}
int main() {
Test(1);
}