編譯器錯誤 C2617
'function' : 不一致的 return 語句
指定的函式沒有宣告的傳回型別,而且先前的 return 語句未提供值。
下列範例會產生 C2617:
// C2617.cpp
int i;
func() { // no return type prototype
if( i ) return; // no return value
else return( 1 ); // C2617 detected on this line
}
可能的解決方式:
// C2617b.cpp
// compile with: /c
int i;
int MyF() {
if (i)
return 0;
else
return (1);
}