maayan maayan - 2 months ago 7x
C Question

Initialize a string in C to empty string

I want to initialize string in C to empty string.
I tried:

string[0] = "";

but it wrote

"warning: assignment makes integer from pointer without a cast"

How should I do it then?


Assuming your array called 'string' already exists, try

string[0] = 0;