a error i can't understand
-
code: std::map amap; char str[]; amap.find(str); // compiler point error to here error: error C2451: conditional expression of type 'class std::_Tree,struct std::map,class std::al locator >::_Kfn,struct std::less,class std::allocator >::iterator' is illegal No user-defined-conversion operator available that can perform this co nversion, or the operator cannot be called i don't know how to cope with it. please help me! thanks. love program
-
code: std::map amap; char str[]; amap.find(str); // compiler point error to here error: error C2451: conditional expression of type 'class std::_Tree,struct std::map,class std::al locator >::_Kfn,struct std::less,class std::allocator >::iterator' is illegal No user-defined-conversion operator available that can perform this co nversion, or the operator cannot be called i don't know how to cope with it. please help me! thanks. love program
Did you correctly include your code within your message, or did the angle brackets get chopped off? A map needs two template parameters, for example:
std::map<int,string>
This is the map key, and the map item. If you have done this then repost your code and escape the < and > (or check the 'do not treat <'s as HTML) and we can take another look. -
code: std::map amap; char str[]; amap.find(str); // compiler point error to here error: error C2451: conditional expression of type 'class std::_Tree,struct std::map,class std::al locator >::_Kfn,struct std::less,class std::allocator >::iterator' is illegal No user-defined-conversion operator available that can perform this co nversion, or the operator cannot be called i don't know how to cope with it. please help me! thanks. love program
char str[]
is not a legal variable declaration - you need to specify the array size. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer. -- Michael P. Butler in the Lounge