On Nov 5, 8:19 pm, "2005" <uws2...@yahoo.comwrote:
Hi
I have
char String[] = "Time";
char temp[];
int slot;
slot = 1;
What I need is:= String[] = "Time1"
temp = (char)slot
strcat(String, temp);
Something is a miss - could someone fix it for me pls.
Java programmer?
something like the following:
const char *String = "Time";
char *temp = (char*)malloc( strlen( String ) + 20 +1 ); /*assume int
can be printed in 20 chars */
int slot = 1;
sprintf( temp, "%s%d", String, slot );
/* code using temp */
free( temp);
/* This is off the top of my head - I haven't compiled this - brave in
this group */