Re: Simplicity has a future
- From: Ian Collins <ian-news@xxxxxxxxxxx>
- Date: Wed, 31 May 2006 21:59:48 +1200
Richard Heathfield wrote:
Ian Collins said:OK, it may be legal C, but it ain't pretty.
Richard Heathfield wrote:
Ian Collins said:
My C compiler gave several screens of errors and warning before giving
up.
Try it again, fixing the trivial error on line 20
Don't bother - it isn't an error.
One good reason for passing C though a C++ compiler:
"/tmp/x.c", line 16: Error: Cannot use const char[82] to initialize
char[81].
Oh yes you can. Not in C++, true - but this is comp.lang.c, not
comp.lang.c++, and the code I posted is C, not C++.
Read the code more carefully. I think you jumped to a false conclusion.
#include <stdio.h>
int main(void)
{
char title__of__the__program[81] =
"C to C++ Translation\nONLY extra casts and renaming"
" of variables are allowed.\n\n\n\n\n";
printf( "%s\n", title__of__the__program );
return 0;
}
I'd rather have the compiler barf.
--
Ian Collins.
.
- Follow-Ups:
- Re: Simplicity has a future
- From: Richard Heathfield
- Re: Simplicity has a future
- References:
- Simplicity has a future
- From: jacob navia
- Re: Simplicity has a future
- From: Tomás
- Re: Simplicity has a future
- From: jacob navia
- Re: Simplicity has a future
- From: Tomás
- Re: Simplicity has a future
- From: Keith Thompson
- Re: Simplicity has a future
- From: Tomás
- Re: Simplicity has a future
- From: Richard Heathfield
- Re: Simplicity has a future
- From: Harald van Dijk
- Re: Simplicity has a future
- From: Ian Collins
- Re: Simplicity has a future
- From: Richard Heathfield
- Re: Simplicity has a future
- From: Ian Collins
- Re: Simplicity has a future
- From: Richard Heathfield
- Simplicity has a future
- Prev by Date: Re: Simplicity has a future
- Next by Date: Regarding free function
- Previous by thread: Re: Simplicity has a future
- Next by thread: Re: Simplicity has a future
- Index(es):