z*n
2 楼
护照公证需要填表吗?还是公证员直接在护照复印件上敲戳签名就行了?
多谢了。
多谢了。
a*t
3 楼
还是一定要找个朋友做translator?还有certification里文件名称写中文名还是英文名
称?
称?
d*n
4 楼
The output of the following piece of simple code to test stl map is very
weird.
//-------------------code-----------------------------
#include
#include
weird.
//-------------------code-----------------------------
#include
#include
M*7
5 楼
micro sd
f*u
7 楼
可以自己翻译,然后找人证明你翻译的对。
d*e
8 楼
change myMap to
map myMap;
map
d*p
10 楼
your compare function wrong.
each key in myMap is converted to a A object with index set to 0 and thus
totally disables the compareA.
change (lhs.index < rhs.index); to lhs.str < rhs.str will populate the map
with 3 elements but not sure it is what u want.
each key in myMap is converted to a A object with index set to 0 and thus
totally disables the compareA.
change (lhs.index < rhs.index); to lhs.str < rhs.str will populate the map
with 3 elements but not sure it is what u want.
z*e
11 楼
try to add explicit to your constructor to see the effect.
explicit A::A(string, int)
explicit A::A(string, int)
d*n
12 楼
Thanks but could you elaborate?
I don't see why the index is set to 0. When the key is converted?
【在 d****p 的大作中提到】
: your compare function wrong.
: each key in myMap is converted to a A object with index set to 0 and thus
: totally disables the compareA.
: change (lhs.index < rhs.index); to lhs.str < rhs.str will populate the map
: with 3 elements but not sure it is what u want.
I don't see why the index is set to 0. When the key is converted?
【在 d****p 的大作中提到】
: your compare function wrong.
: each key in myMap is converted to a A object with index set to 0 and thus
: totally disables the compareA.
: change (lhs.index < rhs.index); to lhs.str < rhs.str will populate the map
: with 3 elements but not sure it is what u want.
t*t
14 楼
First of all, the key here is string. You want to compare 2 strings in your
comparator, not 2 A objects.
But you provide a comparator that accepts 2 A objects. Therefore the 2
strings are converted to 2 A objects, with index set to 0 (you provided
default value). So any 2 strings are always equal.
You need to clear up your concepts. It's totally a mess.
【在 d*******n 的大作中提到】
: Thanks but could you elaborate?
: I don't see why the index is set to 0. When the key is converted?
comparator, not 2 A objects.
But you provide a comparator that accepts 2 A objects. Therefore the 2
strings are converted to 2 A objects, with index set to 0 (you provided
default value). So any 2 strings are always equal.
You need to clear up your concepts. It's totally a mess.
【在 d*******n 的大作中提到】
: Thanks but could you elaborate?
: I don't see why the index is set to 0. When the key is converted?
d*n
15 楼
I see......
I did mess up the logic.
So unless you want to use a self-defined or some weird thing as key, you
probably don't need to define the comparator.
your
【在 t****t 的大作中提到】
: First of all, the key here is string. You want to compare 2 strings in your
: comparator, not 2 A objects.
: But you provide a comparator that accepts 2 A objects. Therefore the 2
: strings are converted to 2 A objects, with index set to 0 (you provided
: default value). So any 2 strings are always equal.
: You need to clear up your concepts. It's totally a mess.
I did mess up the logic.
So unless you want to use a self-defined or some weird thing as key, you
probably don't need to define the comparator.
your
【在 t****t 的大作中提到】
: First of all, the key here is string. You want to compare 2 strings in your
: comparator, not 2 A objects.
: But you provide a comparator that accepts 2 A objects. Therefore the 2
: strings are converted to 2 A objects, with index set to 0 (you provided
: default value). So any 2 strings are always equal.
: You need to clear up your concepts. It's totally a mess.
t*t
16 楼
exactly -- looks like you are comparing the integer, so why not use the
integer as index? even better, use an array?
【在 d*******n 的大作中提到】
: I see......
: I did mess up the logic.
: So unless you want to use a self-defined or some weird thing as key, you
: probably don't need to define the comparator.
:
: your
integer as index? even better, use an array?
【在 d*******n 的大作中提到】
: I see......
: I did mess up the logic.
: So unless you want to use a self-defined or some weird thing as key, you
: probably don't need to define the comparator.
:
: your
d*n
17 楼
here I am doing trying out some tests,
but to your question, key should be chosen by the nature of the problem not
the nature of the data-structure, right? that is, most likely you don't have
the freedom to choose what to be the key.
【在 t****t 的大作中提到】
: exactly -- looks like you are comparing the integer, so why not use the
: integer as index? even better, use an array?
but to your question, key should be chosen by the nature of the problem not
the nature of the data-structure, right? that is, most likely you don't have
the freedom to choose what to be the key.
【在 t****t 的大作中提到】
: exactly -- looks like you are comparing the integer, so why not use the
: integer as index? even better, use an array?
t*t
18 楼
exactly, you select the best data structure for your problem. you seem to
want to use the integer as the key since you compared it -- then you should
use array.
so make up your mind: what do you want to use as key? the string, use map<
string, int> or map; the index, use map or multimap<
int, string> or vector or string[].
you still need to clear up your concepts. it's still a mess.
not
have
【在 d*******n 的大作中提到】
: here I am doing trying out some tests,
: but to your question, key should be chosen by the nature of the problem not
: the nature of the data-structure, right? that is, most likely you don't have
: the freedom to choose what to be the key.
want to use the integer as the key since you compared it -- then you should
use array.
so make up your mind: what do you want to use as key? the string, use map<
string, int> or map
int, string> or vector
you still need to clear up your concepts. it's still a mess.
not
have
【在 d*******n 的大作中提到】
: here I am doing trying out some tests,
: but to your question, key should be chosen by the nature of the problem not
: the nature of the data-structure, right? that is, most likely you don't have
: the freedom to choose what to be the key.
d*n
19 楼
map is what I need and the string is used like a name (i.e. key).
The reason I was comparing index was because I though the map needs a
comparator for the value (class A), so I simply gave it one based on
comparing index, which is not really needed. This turned out to be a
misunderstanding that messed the logic up.
Other than that, nothing is messed up.
should
multimap<
【在 t****t 的大作中提到】
: exactly, you select the best data structure for your problem. you seem to
: want to use the integer as the key since you compared it -- then you should
: use array.
: so make up your mind: what do you want to use as key? the string, use map<
: string, int> or map; the index, use map or multimap<
: int, string> or vector or string[].
: you still need to clear up your concepts. it's still a mess.
:
: not
: have
The reason I was comparing index was because I though the map needs a
comparator for the value (class A), so I simply gave it one based on
comparing index, which is not really needed. This turned out to be a
misunderstanding that messed the logic up.
Other than that, nothing is messed up.
should
multimap<
【在 t****t 的大作中提到】
: exactly, you select the best data structure for your problem. you seem to
: want to use the integer as the key since you compared it -- then you should
: use array.
: so make up your mind: what do you want to use as key? the string, use map<
: string, int> or map
: int, string> or vector
: you still need to clear up your concepts. it's still a mess.
:
: not
: have
相关阅读
请教如何学习算法谁帮我解释一下这个代码regular expression的一个问题Can certification (MS Java etc) substitute CS degree?ld的问题请教c++里面怎么measure running time请教高手:Win32 编程还有用吗?请问如何可以看gunzip的text中的一部分这个python 3000在matlab中如何运行不在current working directory中的script?那里可以下载?在微软工作的人进来挨骂VC++ release VS debug大牛 in Perl and SED?国内的很多高校都有软件学院 (转载)Linux升级问题(Fedora to ???)如何编写HTML email newsletter 谢谢linux 下从c++动态内存操作问题,heap size不够还是别的?有会写firefox addons的吗?问一个C#的问题,这个语句怎么写的? (转载)