| | |
(was) STL <map> question
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2006
Posts: 4
Reputation:
Solved Threads: 0
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:
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
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:
C++ Syntax (Toggle Plain Text)
#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; }
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
![]() |
Similar Threads
- STL <map> question? (C++)
- sorting stl::map (C++)
Other Threads in the C++ Forum
- Previous Thread: A function which will transfer the data from a file to STL( vector or map) object.
- Next Thread: problem using wingdi.h in bcc 5.5
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






