Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > c basics

Reply
Thread Tools

c basics

 
 
lawryy
Guest
Posts: n/a
 
 
Reply With Quote
 
 
 
 
Richard Heathfield
Guest
Posts: n/a
 
      01-23-2008
lawryy said:

> http://computer-language-tutorials.b.../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
 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      01-23-2008
Richard Heathfield <(E-Mail Removed)> writes:
> lawryy said:
>
>> http://computer-language-tutorials.b.../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) <(E-Mail Removed)>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Army1987
Guest
Posts: n/a
 
      01-23-2008
Richard Heathfield wrote:

> lawryy said:
>
>> http://computer-language-tutorials.b.../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")
 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      01-24-2008
Army1987 said:

> Richard Heathfield wrote:
>
>> lawryy said:
>>
>>> http://computer-language-tutorials.b.../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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATI Crossfire - X850 Crossfire Edition and Platform Basics Silverstrand Front Page News 5 09-28-2005 12:44 PM
Computer Memory Basics Silverstrand Front Page News 1 08-23-2005 03:56 AM
SCSI Hard Drive Basics Silverstrand Front Page News 0 08-10-2005 06:28 PM
Basics =?Utf-8?B?U2ltb24gVG9kZA==?= Wireless Networking 0 03-05-2005 09:09 AM
ISO AppleTalk Routing basics help Jeff Mao Cisco 1 10-22-2003 03:05 PM



Advertisments