I\'m currently writing a little program but I keep getting this error when compiling
error: empty character constant
I realize i
There are two ways to do the same instruction, that is, an empty string. The first way is to allocate an empty string on static memory:
char* my_variable = "";
or, if you want to be explicit:
char my_variable = '\0';
The way posted above is only for a character. And, the second way:
#include
char* my_variable = strdup("");
Don't forget to use free() with this one because strdup() use malloc inside.