I can give a try on one more way but it should be a similar to DaWei but in less steps

sprintf(y, "%s%d",y,x);

It will append the x to y but I have not executed it but there can be an issue with \0 of the previous content of y and you can try and see what is the output.