StackOverflow 文件 C++ 教程 auto auto Created: November-22, 2018 關鍵字 auto 是一個型別名,表示自動推斷的型別。 它已經是 C++ 98 中的保留關鍵字,繼承自 C。在舊版本的 C++中,它可以用於明確宣告變數具有自動儲存持續時間: placeholderCopyint main() { auto int i = 5; // removing auto has no effect }現在已經刪除了舊的含義。 基本的自動樣本