That is because you are doing it all wrong you either join them all up in one sequence or move the first pointer along They are designed to be used a completely different way :-) Single line:
snprintf (msgArray, sizeof(msgArray),"%d%s", 1,"main");
Concat sequence (with buffer safety):
char *cur = &msgArray[0];
char *end = &msgArray[sizeof(msgArray)-1];
cur += snprintf(cur, end-cur, "%d", 1);
snprintf(cur, end-cur, "%s", "main");
In vino veritas