C++: Compilation Problem syntax error : identifier '_Wherenode'

Recently I saw a post in Visual C++ forum regarding compilation of the following sample snippet. I’ve modified it to verify the output.

#include <iostream>
#include <vector>
#include <map>
#include <string>
using namespace std;

int main(int argc, char* argv[])
{
vector<string> vs;
vs.push_back(“Hello”);
vector<vector<string> > vvs;
vvs.push_back(vs);map<string, vector<vector<string> > > m;
m["key"] = vvs;
cout<<m["key"].at(0).at(0);
system(“PAUSE”);
return 0;
}

The above code snippet will not compile, it will show an error as follows.”error C2061: syntax error : identifier ‘_Wherenode’ ”

In my understanding the code is perfectly valid and the error should be the bug of Visual C++ compiler. It’s template instantiation thinks that the assignment is not a valid one.

I tried the same in Dev C++. Yes! it’s perfectly working fine.

View CommentsC++: Compilation Problem syntax error : identifier '_Wherenode'

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

blog comments powered by Disqus