R
Richard Heathfield
LR said:
That is certainly valid C (and AFAIK it's valid C++ too), but in C the
following is better style:
int main(void) {
return 0;
}
(I have resisted the temptation to fiddle with brace placement and
tabulation.)
This is also legal C++, but my understanding is that in C++ it is *your*
version that is better style.
I think the real answer is "yes, *but*..."
Phlip wrote:
I'm not sure how that follows.
However, it's been some time since I wrote code for a C compiler, so I
will appreciate any corrections pointing out how this might not be valid
C, but I think the answer is:
int main() {
return 0;
}
That is certainly valid C (and AFAIK it's valid C++ too), but in C the
following is better style:
int main(void) {
return 0;
}
(I have resisted the temptation to fiddle with brace placement and
tabulation.)
This is also legal C++, but my understanding is that in C++ it is *your*
version that is better style.
And so the answer would be yes. Right?
I think the real answer is "yes, *but*..."