Displaying map stl
Posted
by BSchlinker
on Stack Overflow
See other posts from Stack Overflow
or by BSchlinker
Published on 2010-06-10T19:50:10Z
Indexed on
2010/06/10
19:52 UTC
Read the original article
Hit count: 386
Declared a map early on:
map<char*,char*> rtable; // used to store routing information
Now I'm attempting to display the contents of the map:
void Routes::viewroutes(){
typedef map<char*, char*>::const_iterator iter;
for (iter=rtable.begin(); iter != rtable.end(); ++iter) {
cout << iter->second << " " << iter->first << endl;
}
}
Receiving the error "expected primary-expression before '!=' token and for '->' token. Can't seem to understand the error I'm making here. Any ideas?
© Stack Overflow or respective owner