![]() |
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"); } |
Re: How to store CString using Vector in C++
If you want a vector of CStrings then the definition would be vector<CString>. vector<string> will give you a vector of strings, not CStrings.
C++ is case sensitive so vector and Vector are not the same thing. This is only a guess, because you didn't say why you couldn't do it. I'm guessing you got some sort of error, would that be correct? |
Re: How to store CString using Vector in C++
Here's some code I just wrote:
Code:
void test51() |
Re: How to store CString using Vector in C++
Here is an example how to store a textfile (each line) in a vector.
Code:
#include <vector> |
| All times are GMT +5.5. The time now is 09:43. |