Re: Please review my tutorial

From: pete (pfiland_at_mindspring.com)
Date: 11/02/04


Date: Tue, 02 Nov 2004 11:39:02 GMT

James Dennett wrote:
>
> Sathyaish wrote:
>
> > I had recieved an email sometime ago wherein I was asked to write a
> > function that parsed a given string for the longest pallindrome it
> > contained and replaced the pallindrome with another string, given as
> > its second argument. In finding a pallindrome, however, all the
> > characters were to be considered equal. Therefore, a space, a comma,
> > or any punctuation for that matter was to be treated like any other
> > character.
> >
> > In solving that question, here's what I came up with after a try or
> > two:
> >
> > //File R.h
> > #ifndef __R__
>
> Stop right here :)
>
> The rules of C say that you must not use names including
> double underscores (__) in your own code, for macro names
> or identifiers -- they are reserved for use only by people
> implementing C (or C++) translators.
>
> I know that this isn't the response you were looking for
> (hopefully others will cover other angles), but it's a
> simple thing to get right.

That's a common neophyte mistake which I believe results from
the neophyte reading header files, in order to try to learn C.

Header files use the underscore naming convention
because the programmer is supposed to know that he's
not supposed to do that also.

-- 
pete


Relevant Pages

  • Re: Please review my tutorial
    ... >> contained and replaced the pallindrome with another string, ... >> characters were to be considered equal. ... That's a common neophyte mistake which I believe results from ... Header files use the underscore naming convention ...
    (comp.programming)
  • Re: Please review my tutorial
    ... >> contained and replaced the pallindrome with another string, ... >> characters were to be considered equal. ... That's a common neophyte mistake which I believe results from ... Header files use the underscore naming convention ...
    (comp.lang.c)
  • Re: Please review my tutorial
    ... >> contained and replaced the pallindrome with another string, ... >> characters were to be considered equal. ... Only C++ reserves all uses. ...
    (comp.programming)
  • Re: Please review my tutorial
    ... >> contained and replaced the pallindrome with another string, ... >> characters were to be considered equal. ... Only C++ reserves all uses. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Please review my tutorial
    ... >> contained and replaced the pallindrome with another string, ... >> characters were to be considered equal. ... Only C++ reserves all uses. ...
    (comp.lang.c)