How to store CString using Vector in C++

Dear Gurus/Experts in C++,

I am new to C++.My Question is very basic.I need CString to be

stored in Vector, as I am new even after several attempts I dont

know how to do it.Kindly help me.My code is as below:


void Editcontrol(CString prop1,CString prop2,CString prop3)
{
Vector <string> v;

// I need to store CString in Vector, even after many tries I

could not able to do it
}


int main()
{
Editcontrol("Haroon","Rizwan","Noor");

}
Try one more the following

std::vector<CString> v;

v.push_back( ("Haroon" );
v.push_back( ( "Rizwan" );
v.push_back( ( "Noor" );

Or if the compiler supports new features of the C++ then

std::vector<CString> v = { "Haroon", "Rizwan", "Noor" };

Last edited on
Thanks a lot Mr.Vlad
Topic archived. No new replies allowed.