Skip to content

Instantly share code, notes, and snippets.

@cztchoice
Created October 25, 2013 03:27
Show Gist options
  • Save cztchoice/7149044 to your computer and use it in GitHub Desktop.
Save cztchoice/7149044 to your computer and use it in GitHub Desktop.
test name type error, like error: ‘...’ does not name a type
#include<iostream>
#include<vector>
std::vector<int> b;
//This does not name a type
//b.push_back(1);
int c[10];
//This does not name a type too
//c[0] = 1;
int main()
{
std::vector<int> a;
a.push_back(1);
//Here is ok
b.push_back(1);
//Here is ok, too
c[0] = 1;
int d[10];
d[0] = 1;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment