If I stick to using strcpy to copy ... notice how here I can't and even strncpy can't work
instead I would need concatenation of this new character to the rest of the string.
I also tried char backup[strlen(s)+1]; it fails too.
to try again..
void replaceFirstCharacter(char *s,char replaceWith);
char t= "telephone";
x=(char *)malloc( sizeof(char) *10 ); /*9 characters plus null byte.*/
/*so that it works with any string... changing the first character only*/
void replaceFirstCharacter(char *s,char replaceWith)
if (strlen(s) >=1)
backup=(char *)malloc( sizeof(char) * (strlen(s)+1));
backup=replaceWith; /*I guess I should somehow avoid this?*/