StackOverflow 文档 C++ 教程 auto auto Created: November-22, 2018 关键字 auto 是一个类型名,表示自动推断的类型。 它已经是 C++ 98 中的保留关键字,继承自 C。在旧版本的 C++中,它可以用于明确声明变量具有自动存储持续时间: placeholderCopyint main() { auto int i = 5; // removing auto has no effect }现在已经删除了旧的含义。 基本的自动样本