C
Christopher Benson-Manica
I hate to post a snippet, but as usual things work fine when they're
on their own...
map<string,uint> mPInfo;
vector<string> vLayovers; // populated elsewhere
const char* array[elem_count]; // populated elsewhere
for( unsigned int i=0; i < elem_count; ++i ) {
printf( "### Adding %s to map", array );
mPInfo[string(array)]=i;
}
for( vector<const string>::iterator i=vLayovers.begin();
i != vLayovers.end(); ++i ) {
printf( "*** %s %s", i->c_str(), mPInfo.count(*i)?"found":"not found" );
}
Why the heck would I get output like
*** ATL found
### Adding SAN to map
*** ATL found
### Adding SAN to map
*** ATL found
? The map has one item in it, and it is not the item I'm searching
for. Why the heck would it find something that isn't there? Please,
please tell me that I'm doing something stupid here...
on their own...
map<string,uint> mPInfo;
vector<string> vLayovers; // populated elsewhere
const char* array[elem_count]; // populated elsewhere
for( unsigned int i=0; i < elem_count; ++i ) {
printf( "### Adding %s to map", array );
mPInfo[string(array)]=i;
}
for( vector<const string>::iterator i=vLayovers.begin();
i != vLayovers.end(); ++i ) {
printf( "*** %s %s", i->c_str(), mPInfo.count(*i)?"found":"not found" );
}
Why the heck would I get output like
*** ATL found
### Adding SAN to map
*** ATL found
### Adding SAN to map
*** ATL found
? The map has one item in it, and it is not the item I'm searching
for. Why the heck would it find something that isn't there? Please,
please tell me that I'm doing something stupid here...