I wrote this function that\'s supposed to do StringPadRight(\"Hello\", 10, \"0\") -> \"Hello00000\".
char *StringPadRight(char *string, int padded_len, char
You must make sure that the input string has enough space to hold all the padding characters. Try this:
char hello[11] = "Hello"; StringPadRight(hello, 10, "0");
Note that I allocated 11 bytes for the hello string to account for the null terminator at the end.
hello