s****n 发帖数: 700 | 1 I get some problem here.
char a[40];
char b[40];
sprintf(a, "%s", "x1");
sprintf(b, "%s", "x2");
struct cmp_str
{
bool operator()(char const *a, char const *b)
{
return strcmp(a,b) < 0;
}
};
typedef std::map MAPIDS;
MAPIDS m_mapIds;
std::pair< MAPIDS::iterator, bool > _pr_id = m_mapIds.insert( MAPIDS::value_
type(a , b ));
printf("%s %s\n", _pr_id.first, _pr_id.second // look likes I can't
retrieve a and b using the pair
Please help. | e****d 发帖数: 895 | 2 (*_pr_id.first).first and (*_pr_id.first).second.
【在 s****n 的大作中提到】 : I get some problem here. : char a[40]; : char b[40]; : sprintf(a, "%s", "x1"); : sprintf(b, "%s", "x2"); : : struct cmp_str : { : bool operator()(char const *a, char const *b) : {
| p***o 发帖数: 1252 | 3 Probably the same matter as the post 20328 and 20329.
【在 e****d 的大作中提到】 : (*_pr_id.first).first and (*_pr_id.first).second.
| f******y 发帖数: 2971 | 4 不会写C++就换一门别的语言吧。
【在 s****n 的大作中提到】 : I get some problem here. : char a[40]; : char b[40]; : sprintf(a, "%s", "x1"); : sprintf(b, "%s", "x2"); : : struct cmp_str : { : bool operator()(char const *a, char const *b) : {
|
|