So, in order for you to actually write to a string, you have to have writable memory. A string literal (a.k.a. string constant) is not writable -- it's constant, unchanging. Thus, you can't do
Code:
char *foo = "some stuff";
strcat(foo, "more stuff");
What you do is declare an array that is large enough to hold the largest string you need (+1 for the terminating null character), and use sprintf as Tim suggested:
Code:
char my_string[17];
sprintf(my_string, "vote%d", 42);
But I would be remiss if I didn't mention two excellent improvements to the above code: defining a constant for the string length, and using snprintf (documentation). The 'n' is the version that limits how much it writes into your string so you don't overflow it.
Code:
#define MAX_STR_LEN 100
...
// in a function because global variables are evil
char my_string[MAX_STR_LEN + 1]; // +1 for the null terminator
snprintf(my_string, sizeof(my_string), "vote%d", 42);
Bonus: notice that I used sizeof(my_string) for the size of my_string, instead of MAX_STR_LEN. Imagine you wanted to change my_string to be of size SOME_OTHER_CONSTANT. If I used MAX_STR_LEN in the snprintf call, I would have to remember to change it -- and I might forget, leaving open the possibility of an overflow. Using sizeof will always give the right size.