一个关于引用和返回值得问题
sducs 2007-04-26 08:57:22 主要程序:
typedef pair<short,short> location;
typedef vector<location> loc;
typedef vector<string> text;
typedef pair<text*,loc*> text_loc;
text_loc* separate_words(const vector<string> *text_file)
{
vector<string> *words=new vector<string>;
vector<location> *locations=new vector<location>;
.......
return new text_loc(words,locations);
}
怎么函数返回值是text_loc*类型
而return的是new text_loc(words,locations),这是个指针吗?