In C, a string is an array of bytes. You can't assign an "empty byte", but you have to shift the remainder of the bytes forward.
Here's one way of how to do that:
char *write = str, *read = str;
do {
// Skip space and tab
if (*read != ' ' && *read != '\t')
*(write++) = *read;
} while (*(read++));
Remember that literal strings in C are usually in write-protected memory, so you have to copy to the heap before you can change them. For example, this usually segfaults:
char *str = "hello world!"; // Literal string
str[0] = 'H'; // Segfault
You can copy a string to the heap with strdup
(among others):
char *str = strdup("hello world!"); // Copy string to heap
str[0] = 'H'; // Works
EDIT: Per your comment, you can skip only initial whitespace by remembering the fact that you've seen a non-whitespace character. For example:
char *write = str, *read = str;
do {
// Skip space and tab if we haven't copied anything yet
if (write != str || (*read != ' ' && *read != '\t')) {
*(write++) = *read;
}
} while (*(read++));