理论上来讲,{}可以划分为一个单独的作用域,但是经过测试发现,for循环内声明的int[]无法在for循环外访问,而for循环内声明的vector<int>可以在for循环之外正常访问。 不愧是你,cpp。 #include <iostream> #include <vector> using n