[Solved] Replacing sub-string of a String with another String in c
The sprintf command has the following declaration: sprintf(char *str, const char *format, …); your declaration in question is: sprintf(buffer+(p-str), “%s%s”, rep, p+strlen(orig)); The sprintf command writes to the character pointer str, the values rep and p+strlen(orig) in accordance with the format string “%s%s”. Essentially, it is simply combining (or concatenating) rep and p+strlen(orig) in buffer+(p-str). … Read more