c basics

Discussion in 'C Programming' started by lawryy, Jan 23, 2008.

  1. lawryy

    lawryy Guest

    1. Advertising

  2. lawryy said:

    > http://computer-language-tutorials.blogspot.com/2008/01/c-basics.html


    The first significant technical error occurs in the first program
    presented:

    +++ quote begins +++

    As an extreme example the following C code (mystery.c) is actually legal C
    code.
    #include

    +++ quote ends +++

    Whilst it is certainly true that #include is part of the C language (it's a
    preprocessor directive), it can't appear on its own like that. Proof:

    3.8.2 Source file inclusion

    Constraints

    A #include directive shall identify a header or source file that
    can be processed by the implementation.


    Thus, the absence of identification of a header or source file is a
    constraint violation which requires the implementation to issue a
    diagnostic message. Translation may or may not continue, at the
    implementation's discretion; if it continues, the behaviour of the
    resulting program is undefined.

    When that one's fixed, no doubt you can persuade someone to look for the
    second significant technical error. Iterate that process sufficiently
    often, and you might end up with a C tutorial that's worth looking at.
    But, as it stands, no.

    --
    Richard Heathfield <http://www.cpax.org.uk>
    Email: -http://www. +rjh@
    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    "Usenet is a strange place" - dmr 29 July 1999
     
    Richard Heathfield, Jan 23, 2008
    #2
    1. Advertising

  3. Richard Heathfield <> writes:
    > lawryy said:
    >
    >> http://computer-language-tutorials.blogspot.com/2008/01/c-basics.html

    >
    > The first significant technical error occurs in the first program
    > presented:
    >
    > +++ quote begins +++
    >
    > As an extreme example the following C code (mystery.c) is actually legal C
    > code.
    > #include
    >
    > +++ quote ends +++
    >
    > Whilst it is certainly true that #include is part of the C language (it's a
    > preprocessor directive), it can't appear on its own like that.

    [...]

    That appears to have been at least partly an HTML error. Looking at the
    HTML source of the page, it actually says

    <pre>#include <stdio.h><br /><br /><br /></stdio.h></pre>

    Probably whatever HTML editor was used thought <stdio.h> was a
    directive, and tried to close it; apparently it also lost the rest of
    the program. Of course that's not excuse for not bothering to see
    what the page actually looks like. A lot of the other examples appear
    to have the same problem.

    <OT>
    For anyone posting C source code in an HTML page, remember that <pre>
    doesn't inhibit the interpretation of the '<' character.
    </OT>

    [...]

    > When that one's fixed, no doubt you can persuade someone to look for the
    > second significant technical error. Iterate that process sufficiently
    > often, and you might end up with a C tutorial that's worth looking at.
    > But, as it stands, no.


    --
    Keith Thompson (The_Other_Keith) <>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Jan 23, 2008
    #3
  4. lawryy

    Army1987 Guest

    Richard Heathfield wrote:

    > lawryy said:
    >
    >> http://computer-language-tutorials.blogspot.com/2008/01/c-basics.html

    >
    > The first significant technical error occurs in the first program
    > presented:
    >
    > +++ quote begins +++
    >
    > As an extreme example the following C code (mystery.c) is actually legal C
    > code.
    > #include
    >
    > +++ quote ends +++

    I didn't bother to look at it, but probably they used literal angle
    brackets in HTML, where &lt; and &gt; should be used.

    --
    Army1987 (Replace "NOSPAM" with "email")
     
    Army1987, Jan 23, 2008
    #4
  5. Army1987 said:

    > Richard Heathfield wrote:
    >
    >> lawryy said:
    >>
    >>> http://computer-language-tutorials.blogspot.com/2008/01/c-basics.html

    >>
    >> The first significant technical error occurs in the first program
    >> presented:
    >>
    >> +++ quote begins +++
    >>
    >> As an extreme example the following C code (mystery.c) is actually legal
    >> C code.
    >> #include
    >>
    >> +++ quote ends +++

    > I didn't bother to look at it, but probably they used literal angle
    > brackets in HTML, where &lt; and &gt; should be used.


    Well, they can take that up with comp.markup.html if such a beast exists.
    The point is not how it's broken - the point is that it *is* broken.

    If he fixes this one and tells us, I'll gladly look for another couple of
    errors, to help him in his bid for perfection. And if he fixes *those* and
    tells us, I may even look for another three.

    --
    Richard Heathfield <http://www.cpax.org.uk>
    Email: -http://www. +rjh@
    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    "Usenet is a strange place" - dmr 29 July 1999
     
    Richard Heathfield, Jan 24, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brendan Illingworth

    Book on VHDL basics and HDL based design

    Brendan Illingworth, Jan 13, 2006, in forum: VHDL
    Replies:
    2
    Views:
    2,116
    Ralf Hildebrandt
    Jan 13, 2006
  2. Jacob Yang [MSFT]

    Re: Starting basics

    Jacob Yang [MSFT], Oct 16, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    325
  3. Brian Shannon

    Basics of Javascript

    Brian Shannon, Jun 25, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    381
    clintonG
    Jun 25, 2004
  4. Simon Harris

    Class Basics (Slightly OT?)

    Simon Harris, May 8, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    377
    Web Team @ Borough of Poole
    May 11, 2005
  5. Andrew Chalk

    Basics of Forma Layout

    Andrew Chalk, Dec 16, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    450
    Joe King
    Dec 17, 2005
Loading...

Share This Page