Hello,
StringArray is just a vector of type string, and so you can write code such as:
void test()
{
StringArray sa(3);
sa[0] = "one";
sa[1] = "two";
sa[2] = "three";
test2( sa );
}
void test2(StringArray& sa)
{
for(int ii = 0; ii < sa.GetSize(); ii++)
out_str( sa[ii] );
}
which is same as:
void test()
{
vector<string> sa(3);
sa[0] = "one";
sa[1] = "two";
sa[2] = "three";
test2( sa );
}
void test2(vector<string>& sa)
{
for(int ii = 0; ii < sa.GetSize(); ii++)
out_str( sa[ii] );
}
Easwar
OriginLab