error C2440: '=' : cannot convert from 'const char *' to 'char *
<p>Actually this is my code: I use command line argument, argv[1] is my one of the input file name. I want to change argv[2] and argv[3] dynamically inside the for loop.</p>

<pre><code>int main(int argc, char *argv[])
{
mf::Mesh mesh;
mf::Reader reader;
mf::Writer writer;
mf::Normalizer normalizer;
int n;

if (argc != 2) {
std::cerr &lt;&lt; "usage: " &lt;&lt; argv[0] &lt;&lt; " [Input OBJ Path] " &lt;&lt; std::endl;
exit(EXIT_FAILURE);
}


/////// New Code Start/////////////
FILE *fp;

fp=fopen(argv[1],"r");

unsigned int i,j;
unsigned int number_of_lines = 0;
unsigned int count_row=0;

double *read_test_off_file; 

std::string line;
std::ifstream myfile(argv[1]);

while (std::getline(myfile,line))
{
++number_of_lines;
}

std::cout &lt;&lt; "Number of lines in text file: " &lt;&lt; number_of_lines&lt;&lt;endl; 

read_test_off_file=new double[number_of_lines];

for(i=0;i&lt;number_of_lines;i++)
{
fscanf(fp,"%lf",&amp;read_test_off_file[i]);    
}

int test=0;
cout&lt;&lt;"Scanf Complete."&lt;&lt;endl;  
for(j= 0;j&lt;number_of_lines;j++)
{
cout&lt;&lt; j &lt;&lt; ":" &lt;&lt; read_test_off_file[j] &lt;&lt; endl;

std::string first_part("m");
std::string second_part;
std:stringstream ss;
ss &lt;&lt; read_test_off_file[j];
second_part = ss.str();
std::string normalize_part("_normalize");
std::string last_part(".off");

std::string input_file_name=first_part+second_part+last_part;
argv[2]=input_file_name.c_str();

std::string output_file_name=first_part+second_part+normalize_part+last_part;

argv[3]= output_file_name.c_str();

if (reader.read_off(mesh, argv[2]) == false) 
{
exit(EXIT_FAILURE);
}



normalizer.triangulation(mesh);
normalizer.translation(mesh);
normalizer.scaling(mesh);
normalizer.rotation_point_svd(mesh, 16500);

writer.write_off(mesh, argv[3]);

test++;

}
</code></pre>

<p>....................................................</p>
