Hi guys, I would like to add a char to the end of a char*
So imagine the following:
char* test = "ABC"
I want to add D to the end of it to get
test == "ABCD"
for the sake of argument, I can not use strcat as I have to pass D as a char not a string ('D' not "D")
As this is proving to be rather difficult I was hoping you fine people could help me.
I saw a nice idea on here where someone produced a method like below:
char* appendChar(char* originalString, char toAppend)
{
char* complete = (originalString with toAppend appendended to the end)
return complete;
};
Obviously I'm missing a big chunk out of there but you get the idea. The problem with the method was that it was written for C++ and wouldn't work for me in C.
Let's brainstorm then, how would you guys do this?