一个小小小练习 不知为何报错。。
感觉没错呀。。萌萌哒。。#include<iostream>
#include<vector>
using namespace std;
using std::vector;
void main()
{
vector<int> v1{10};
cout<<v1[0];
}
*********************************************************************************
1>------ Build started: Project: 11, Configuration: Debug Win32 ------
1> 22.cpp
1>c:\users\jin\documents\visual studio 2010\projects\11\11\22.cpp(7): error C2601: 'v1' : local function definitions are illegal
1> c:\users\jin\documents\visual studio 2010\projects\11\11\22.cpp(6): this line contains a '{' which has not yet been matched
1>c:\users\jin\documents\visual studio 2010\projects\11\11\22.cpp(7): error C2143: syntax error : missing ';' before '}'
1>c:\users\jin\documents\visual studio 2010\projects\11\11\22.cpp(8): error C2065: 'v1' : undeclared identifier
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========