maayan maayan - 1 year ago 73
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?

Answer Source

Assuming your array called 'string' already exists, try

string[0] = 0;