Although I know that converting const char *
to char *
is almost banned in C/C++ because of many problems, I am caught up in a situation where I think I have to convert const char *
to char *
.
I get a string from a text file as string by using c_str
and I want to modify this string. However the problem is that c_str
converts string into const char *
. So is it a good choice to use strdup
in this case or is there any better idea in doing this?