Thread: quick programming in c by Peter monadjemi and Eckart Winkler

  1. #1
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110

    Lightbulb quick programming in c by Peter monadjemi and Eckart Winkler

    ive just got this book called quick programming in c and i was surprised to see this in it
    Code:
    #include <stdio.h>
    void main{
    printf("Hello world");
    }
    this book is supposed to be ANSI-C but that should mean that void main is ansi-c

  2. #2
    Registered User Sargnagel's Avatar
    Join Date
    Aug 2002
    Posts
    166
    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;
    }

  3. #3
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110
    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"
    just to let ppl know u can buy this book but is NOT ansi-c as they said it

  4. #4
    Registered User Sargnagel's Avatar
    Join Date
    Aug 2002
    Posts
    166
    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:
    Code:
    #include <stdio.h>
    
    main()
    {
        printf("Hello, World!");
        return 0;
    }
    ... and on the back is printed: "Covers all ANSI C Compilers" ...
    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.
    ... and the authors are "great" programmers, too, and also write articles for well known computer magazines ...

  5. #5
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110
    Oh, oh, this book must have been written quickly, too.
    guess u are right about it

  6. #6
    Registered User Sargnagel's Avatar
    Join Date
    Aug 2002
    Posts
    166
    Oh man, I can't believe it! I've just checked another book of mine and discovered this ... enjoy
    Code:
    /* The hello, world program */
    
    void main(void)
    {
        printf("hello, world");
    }
    I wonder how many newbies were frustrated because of compiler errors ... no #include ... *lol*
    Last edited by Sargnagel; 11-07-2002 at 02:45 PM.

  7. #7
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110
    void mainers are DOOMED according to Salem so u better run bad authors of c programming books

Popular pages Recent additions subscribe to a feed