
Is char buf[30] = {0} necessary ?
Quote:
> char buf[30] = {0 };
> Should I initialize buf with null character above ? Isn't default
> initialization assured by the standard ?
Only if it's "global" (or rather, has file scope) or it's an object of
static storage.
For local variables, this initialisation is correct. (Assuming you want
an array of '\0' characters.)
If this array is for a string, you might get away with just assigning
the first element. It's up to you.
Bill, 'ip 'ip,