I am suppose to create a nested loop that cycles through a dynamically allocated array (story) find the char ''*', and fill in the position where this char is with information from the other dynamically allocated array (user_input). Then store this replacement information in a new dynamically allocated array called body to be cout. Here is the error:
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Alloc=std::allocator<char>
1> ]
There is no context in which this conversion is possible
can anyone tell me what I'm doing wrong? Here is my code:
void create_story(string & user_inputs, string *story, int num_lines,
string **body)
{
*body = new string[num_lines];
for (int i = 0; i < story[i].length; i++)
{
if (story[i] == "*")
{
body[i];
}
for (int j = 0; j < story[i].length(); j++)
{
if (story[i][j] == '*')
{
cout << "I found it at character number: " << i;
*body[i] += user_inputs;
}
else
{
body[i] += story[i][j];
}
}
}
}