共用方式為


編譯器錯誤 C3530

'auto' 無法與任何其他型別規範合併使用

有某個型別規範與 auto 關鍵字搭配使用。

更正這個錯誤

  • 不要在使用 auto 關鍵字的變數宣告中使用型別規範。

範例

下列範例會產生 C3530 錯誤,因為使用了 auto 關鍵字及 int 型別來宣告變數 x,而且是使用 /Zc:auto 來編譯。

// C3530.cpp
// Compile with /Zc:auto
int main()
{
   auto int x;   // C3530
   return 0;
}

請參閱

參考

auto 關鍵字