Re: string-486.h?

From: Bill Wendling (wendling@ganymede.isdn.uiuc.edu)
Date: Tue Feb 29 2000 - 16:38:42 EST


Also sprach David Schleef:
} The problem is that "mystring" is a null-terminated ASCII string and char str[12]
} is an array of 12 chars, not an ASCII string. One of the arguable aspects of C
} is that _all_ elements get initialized in an array. It is similar to
}
} {
} int zeros[10]={ 0 };
} struct {
} int foo;
} int bar;
} }x = { 1 };
} }
}
} In both cases, the entire array or structure has to be cleared. As Richard
} said above, "the problem is bad 'C' code." Personally, I think that
} auto-initialization of auto variables is a nasty feature, and I try to
} avoid using it in my own code in cases where it is inequivalent to
} initialization of global variables.
}
Sure. It's a matter of style/opinion whether one would allow auto
initialization of arrays. The above is said to be implied in the standard
(it's not explicit in the "old" ISO standard) since it was made explicit
AFAIK in C9X.

I was only saying that, something declared global is automagically
initialized to zeros...that's all...

-- 
|| Bill Wendling			wendling@ganymede.isdn.uiuc.edu

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:23 EST