If we're using C++, we should probably use strings rather than raw arrays of char and C library functions.
1 2 3 4 5 6 7 8 9
#include <iostream>
#include <string>
int main() {
std::string name = "last";
name = "first, " + name;
std::cout << name << '\n' ;
}
But if you're stuck using raw arrays of char and C library functions the "simple" way would be to copy or move the "last" bit of the string to where you want it in the array, then copy the "first" bit where you want that. Unfortunately there is no library function that will do that for you with a single call.