Have a code as shown below. I have problem passing the arguments.
stringstream data;
char *addr=NULL;
strcpy(addr,retstring().c_str());
retstring()
is a function that returns a string.
//more code
printfunc(num,addr,data.str().c_str());
I get the error
invalid conversion from 'const char*' to 'char*'.
initializing argument 3 of 'void Printfunc(int, char*, char*)'on argument 3 of the function
on the above line. The function is called as shown below
void Printfunc(int a, char *loc, char *stream)
please let me know if I need to change any initialization.
See Question&Answers more detail:os