vector/array to string problem
I have an array of strings which i'm trying to read one by one into a string. The array is filled correctly, and has all the elements I want. Here's the code I have to read it into a string:
string f = "";
for(int i = 0; i < 45; i ++)
if(vs[i +1] == "")
f += vs[i];
f += vs[i] + ", ";
As you might have guessed, i'm trying to construct an SQL query that gets passed to another method. The last element in the array cannot have a ", " next to it b/c of the query structure.
anyway, the string f gets messed up at one point. It just wont' accept any more strings from the array after a while.
This is all happening inside a class with the header "__gc" -- a managed C++ class. When i tried this same thing in a regular old unmanaged Main method, it worked fine. I'm so confused...can someone please tell me what's wrong?
The array is made up of std::string, and f is also std::string