Thomas Stegen said:
But the point was made that the correct way was:
char *a, b;
Since the context was the problem of getting types wrong
I assumed it was implied that the following is incorrect:
char* a, b;
The same post said that even though this last one was
incorrect it is not a language flaw. I am saying that
if something incorrect is allowed, then that is a flaw
in itself.
"Incorrect" and "flaw" are largely subjective terms, and I'm not
going to try to define either one.
As far as the language is concerned, the following are all legal
and equivalent:
char *a, b;
char* a, b;
char*a,b;
char * a , b ;
Of these, I consider the first to be good style, and the others to be
poor style. The second, in particular, is misleading -- but then so
is this:
char string_pointer;
but I wouldn't expect a compiler to diagnose any of them. I suppose
you could say they're "incorrect", but not in the context of the
language.
The C language is largely free-form, allowing programmers to format
their code as they like. I don't consider the fact that this allows
for poorly formatted code (see the IOCCC) to be a flaw in the
language, any more than the failure to diagnose the two errors in
this:
printf("helo, world/n");
is a flaw in the language.
C, as the saying goes, gives you enough rope to shoot yourself in the
foot. Decide for yourself whether this is a flaw (and don't expect
more than 50% of programmers to agree with whatever you decide).