I am trying to convert a file path which just have one slash to double slash as shown on the code below. but it gives me the error shown at the end
#include<algorithm>
std::string file_path;
using std::replace;
while(fgets(fname_buffer,1024,flist))
{
token = strtok( fname_buffer," ,\t");
file_size=atol(token);
token = strtok(NULL, " ,\t");
strncpy((char*)file_fp,token,32);
file_fp[32]='\0';
token = strtok(NULL, "\n");
file_path=token;
replace(file_path.begin(),file_path.end(),'\\',"\\\\");
//file_path.replace(file_path.begin(),file_path.end(),'\\','\\\\');
error C2664: 'std::basic_string<_Elem,_Traits,_Ax> &std::basic_string<_Elem,_Traits,_Ax>::replace(unsigned int,unsigned int,const _Elem *,unsigned int)' : cannot convert parameter 1 from 'std::_String_iterator<_Elem,_Traits,_Alloc>' to 'unsigned int'