I have a char array
called names[50]
Basically, I use
strncpy(this->names, names, sizeof(names))
however this will only truncate characters at the end.
How do I truncate characters from the start?
For example, BillSteveLinusMikeGeorgeBillSteveLinusMikeGeorgeGeorge
should be teveLinusMikeGeorgeBillSteveLinusMikeGeorgeGeorge
You can change the source address for strncpy:
Notice that no null-character is implicitly appended at the end of the destination string if the source string is longer than num.