How do I append a single char to a string in C?
i.e
char* str = \"blablabla\";
char c = \'H\';
str_append(str,c); /* blablablaH */
I do not think you can declare a string like that in c. You may only do that for const char* and of course you can not modify a const char * as it is const.
You may use dynamic char array but you will have to take care of the reallocation.
EDIT: in fact this syntax compiles correctly. Still you can should not modify what str points to if it is initialized in the way you do it (from string literal)