I have a vector of chars and I'm trying to put the chars into a vector of strings:
The problem is that lines '1' and '2' (and other lines like them) produce the following error:Code:int iByteCounter = 0; vector<char> vc1TempChar; vector<char> vc2TempChar; vector<string> vs1String(1000); vector<string> vs2String(1000); vector<int> viBeginByte; vector<stringmatch> vsmStringMatch; struct stringmatch { int b1; // Beginning of string in first file int e1; // End of string first file int b2; // Beginning of sring 2nd file int e2; // end of string 2nd file vector<char> vcStringMatch; }; vector<stringmatch> vsmStringMatch; ................. vs1String.push_back(vc1TempChar[iByteCounter]); // line '1' vs2String.push_back(vc2TempChar[iByteCounter]); // line '2' viBeginByte.push_back(iByteCounter); vsmStringMatch.push_back(smTempStringMatch);
[error]
invalid conversion from `char' to `const char*'
initializing argument 1 of `std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]'
[/error]
What does the error mean and what did I do wrong?



LinkBack URL
About LinkBacks


