I would like to append the integer n to the string a, resulting in "asd 2". For some reason I cannot figure out how to do it, I have tried casting int to char and using strcat(), I tried it with sprintf() yet none of it works.
char* a = "asd ";
int n = 2;
Surely there has to be a simple way to do this? I would appreciate any help