Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What C does /prog/ prefer?

Name: Anonymous 2010-08-28 19:43

[ ] K&R C
[ ] C89
[ ] C99
[ ] C1x

Name: Anonymous 2010-08-30 15:44

If you're going to initialise something, initialise all of it. If you can't, it shouldn't be a single entity.
So you're saying
struct some_struct x;
x.a = &a;
x.b = NULL;
x.c = NULL;
x.d = NULL;

is better than
struct some_struct x = { .a = &a };
?

They're less readable than doing the same thing with named functions or macros, because they overlap with existing syntax.
Sure,
int a[] = { 1, 2, 3, 4, 5 };
/* 5 completely unrelated lines of code */
some_function(a);

is so much more readable than
some_function((int [5]){ 1, 2, 3, 4, 5 });

POSIX already provided these.
Not everyone wants all of POSIX, and exact-width integer types are very useful.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List