ive just got this book called quick programming in c and i was surprised to see this in it
this book is supposed to be ANSI-C but that should mean that void main is ansi-c :confused:Code:#include <stdio.h>
void main{
printf("Hello world");
}
Printable View
ive just got this book called quick programming in c and i was surprised to see this in it
this book is supposed to be ANSI-C but that should mean that void main is ansi-c :confused:Code:#include <stdio.h>
void main{
printf("Hello world");
}
Oh, oh, this book must have been written quickly, too. ;)
The following code is ANSI-C conform:
Code:#include <stdio.h>
int main()
{
printf("Hello world");
return 0;
}
i know its wrong but i was surprised to see this in it especially when u see at the back of the book that the authors are windows programmers (95 and NT) and one even writes ,and i quote from the book,"very good articles for computer magazines and books":confused:
just to let ppl know u can buy this book but is NOT ansi-c as they said it :mad:
I've just checked a book I've bought a long time ago: "Teach yourself C in 21 days". I am glad that I've come across this forum because I've just found the following "Hello World" source code in this book:
... and on the back is printed: "Covers all ANSI C Compilers" ...Code:#include <stdio.h>
main()
{
printf("Hello, World!");
return 0;
}
At least they've included "return 0" in the source code. ;) It seems to be difficult to write an ANSI C conform version of this very tiny program. :rolleyes:
... and the authors are "great" programmers, too, and also write articles for well known computer magazines ...
guess u are right about it:DQuote:
Oh, oh, this book must have been written quickly, too.
Oh man, I can't believe it! I've just checked another book of mine and discovered this ... enjoy :D
I wonder how many newbies were frustrated because of compiler errors ... no #include ... *lol*Code:/* The hello, world program */
void main(void)
{
printf("hello, world");
}
:p;):D
void mainers are DOOMED according to Salem:cool: so u better run bad authors of c programming books:D :p