I want to insert a series of characters into a string... These characters are stored in a multidimensional array and are not necessarily known. I am trying to do this using the string.insert() function however i am getting an error
Error 1 error C2664: 'std::_String_iterator<_Elem,_Traits,_Alloc> std::basic_string<_Elem,_Traits,_Ax>::insert(std::_String_const_iterator<_Elem,_Traits,_Alloc>)' : cannot convert parameter 1 from 'char' to 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' c:\users\tyler\documents\visual studio 2010\projects\cs150_program_3\cs150_program_3\grid_driver.cpp 121 1 cs150_Program_3
I don't understand what a string is if not a series of characters so i cant figure out why it is upset that i am trying to insert characters into it help?
string temp;
int i, j;
//gets horizontal number groups
for(i=0;i<G.getHeight();i++)
{
for(j=0;j<G.getWidth();j++)
{
if (G.at(i,j)!= 'X')
{
temp.insert(j, G.at(i,j));
}
if (G.at(i,j)== 'X')
break;
}//inner for
if ((int) temp.size() >= Sizes[0] && (int) temp.size() <= Sizes[K])
list.insert(temp);
temp.clear();
}//outter for
this is it basically... G.at(i,j) is calling a class member function that is returning the address of the character in a specific position of an array
string temp;
int i, j;
//gets horizontal number groups
for(i=0;i<G.getHeight();i++)
{
for(j=0;j<G.getWidth();j++)
{
if (G.at(i,j)!= 'X')
{
temp+=G.at(i,j);
}
if (G.at(i,j)== 'X')
break;
}//inner for
if ((int) temp.size() >= Sizes[0] && (int) temp.size() <= Sizes[K])
list.insert(temp);
temp.clear();
}//outter for