As simple as that. I’m on C++ btw. I’ve read the cplusplus.com’s cstdlib library functions, but I can’t find a simple function for this.
I know the length of the char, I only need to erase last three characters from it. I can use C++ string, but this is for handling files, which uses char*, and I don’t want to do conversions from string to C char.
As simple as that. I’m on C++ btw. I’ve read the cplusplus.com’s cstdlib library
Share
If you don’t need to copy the string somewhere else and can change it
If you need to copy it (because it’s a string literal or you want to keep the original around)