Get ESP32 Chip ID into a string variable (Arduino/C++ newbie here)
You can combine all your work into one single line with the snprintf. You aren't limited to just one variable, and you can add plain text:

char ssid[23];

snprintf(ssid, 23, "MCUDEVICE-%04X%08X", chip, (uint32_t)chipid);