It maybe seems to be a silly question but i really need to clarify this:
Will this bring any danger to my program?
Is the const_cast
even needed?
If i change the input pointers values in place will it work safely with std::string
or will it create undefined behaviour?
So far the only concern is that this could affect the string "some_text" whenever I modify the input pointer and makes it unusable.
std::string some_text = "Text with some input";
char * input = const_cast<char*>(some_text.c_str());
Thanks for giving me some hints, i would like to avoid the shoot in my own foot