I have a question about the map-question JoBe asked at the start of this post. I'm also trying to build a program using <map>, but when i compile i get error that point to code inside the MAP-file.
I saw your post here, and i tried your small program, but even then i get 2 errors inside the MAP-file, and also those warnings you asked about.
I don't know why i get those errors.
JoBe's code was:
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main()
{
typedef map<string, int, less<string> > maptype;
maptype M;
M["Jan"] = 1234;
M["Piet"] = 9999;
M["Piet"] = 3456;
M["Klaas"] = 5678;
for(maptype::iterator i = M.begin(); i != M.end(); ++i)
cout<< (*i).first <<" "<< (*i).second <<endl;
cout<<"Press any key to continue!\n";
cin.get();
return 0;
}
When i make a new project (win32 console app) and i compile it, i get these 2 errors:
c:\program files\microsoft visual studio\vc98\include\map(16) : error C2143: syntax error : missing ';' before 'namespace'
c:\program files\microsoft visual studio\vc98\include\map(16) : error C2501: 'B' : missing storage-class or type specifiers
Anyone any idea why this happens?
TIA