Nice tutorial for Beginners

Discussion in 'C Programming' started by Frank, Dec 8, 2009.

  1. Frank

    Frank Guest

    On Tue, 08 Dec 2009 21:03:18 +1300, Ian Collins wrote:

    > Additya wrote:
    >> Hello friends ,
    >>
    >> As the C language is the basic of all the languages , here is the nice
    >> tutorial from which you may start learning it C. Its a nice tutorial
    >> in the pdf format which you can also download it for free.
    >> http://www.ezdia.com/C_Tutorial/Content.do?id=736

    >
    > For beginners 25 years ago maybe, but not today. Lots of old K&R C.


    I don't know which way I'd go on that. If it's K&R2, isn't that late
    enough to begin a development that would not want to tackle differences
    between C90 and C99 off the bat?

    I guess the one thing I'd bring up is that you can comment with the double
    slash now.
    --
    frank
     
    Frank, Dec 8, 2009
    #1
    1. Advertising

  2. Frank

    Additya Guest

    Hello friends ,

    As the C language is the basic of all the languages , here is the nice
    tutorial from which you may start learning it C. Its a nice tutorial
    in the pdf format which you can also download it for free.
    http://www.ezdia.com/C_Tutorial/Content.do?id=736
     
    Additya, Dec 8, 2009
    #2
    1. Advertising

  3. Frank

    Ian Collins Guest

    Additya wrote:
    > Hello friends ,
    >
    > As the C language is the basic of all the languages , here is the nice
    > tutorial from which you may start learning it C. Its a nice tutorial
    > in the pdf format which you can also download it for free.
    > http://www.ezdia.com/C_Tutorial/Content.do?id=736


    For beginners 25 years ago maybe, but not today. Lots of old K&R C.

    --
    Ian Collins
     
    Ian Collins, Dec 8, 2009
    #3
  4. On 8 Dec, 07:17, Additya <> wrote:

    > As the C language is the basic of all the languages ,


    I think you'd find a fair number of people who'd argue *that* one.

    > here is the nice
    > tutorial from which you may start learning it C.


    there are few good online tutorials for C. I believe Steve Summit
    produced a good one. This one is very pretty.

    In summary it is too old and too DOS oriented to be recomended. It is
    not suitable for a beginner. I gave up skimming it around chapter 12.

    > It's a nice tutorial
    > in the pdf format which you can also download it for
    > free.http://www.ezdia.com/C_Tutorial/Content.do?id=736


    It has a faintly old fashioned style to it. "if your disk is less than
    800K..." "you cann't use more than 8 characters in an identifier" "
    experienced C programmers tend not to use underscores" frequent
    mention of Pascal.

    After three or four examples they still
    - have no return value from main
    - use printf() without a prototype

    "A general rule of thumb for modern compilers is that char is at least
    8 bits, short is at least 16 bits, long is at least 32 bits,"

    "As a consequence, you should use either short or long in preference
    to int (despite
    its heavy use in this tutorial), and should avoid double where
    possible."

    [if you shouldn't use int why are they using it?!]

    section 5.1 use of K&R style function definitions. Use of functions
    without a prototype in scope. This probably kills it as a reasonable
    tutorial on modern systems.

    #define WRONG(A) A*A*A /* Wrong macro for cube */
    #define CUBE(A) (A)*(A)*(A) /* Right macro for cube */

    could do with another set of brackets

    "A string is a group of characters, usually letters of the alphabet."

    pointers and strings stuff is a little confused (section 8.8)

    chapter 9 we finally get standard headers!
    # include "/sys/stdio.h"

    use of <> includes depracated!

    section 9.7 very bad advice on handling line terminators. Non-DOS
    systems are described as "non-standard".
     
    Nick Keighley, Dec 8, 2009
    #4
  5. Frank

    Ian Collins Guest

    Frank wrote:
    > On Tue, 08 Dec 2009 21:03:18 +1300, Ian Collins wrote:
    >
    >> Additya wrote:
    >>> Hello friends ,
    >>>
    >>> As the C language is the basic of all the languages , here is the nice
    >>> tutorial from which you may start learning it C. Its a nice tutorial
    >>> in the pdf format which you can also download it for free.
    >>> http://www.ezdia.com/C_Tutorial/Content.do?id=736


    >> For beginners 25 years ago maybe, but not today. Lots of old K&R C.

    >
    > I don't know which way I'd go on that. If it's K&R2, isn't that late
    > enough to begin a development that would not want to tackle differences
    > between C90 and C99 off the bat?


    It's very old pre-standard K&R C.

    --
    Ian Collins
     
    Ian Collins, Dec 8, 2009
    #5
  6. On 8 Dec, 07:09, Frank <> wrote:
    > On Tue, 08 Dec 2009 21:03:18 +1300, Ian Collins wrote:
    > > Additya wrote:
    > >> Hello friends ,

    >
    > >> As the C language is the basic of all the languages , here is the nice
    > >> tutorial from which you may start learning it C. Its a nice tutorial
    > >> in the pdf format which you can also download it for free.
    > >>http://www.ezdia.com/C_Tutorial/Content.do?id=736

    >
    > > For beginners 25 years ago maybe, but not today.  Lots of old K&R C.


    noramally (and in this case too) "K&R C" means "K&R1 C". This tutorial
    uses the uses the pre-ANSI format for function definitions.

    square(number) /* This is the square function */
    int number;
    {
    int numsq;
    numsq = number * number; /* This produces the square */
    sum += numsq;
    }

    IMHO this was the biggest mistake C ever made.


    > I don't know which way I'd go on that.  If it's K&R2, isn't that late
    > enough to begin a development that would not want to tackle differences
    > between C90 and C99 off the bat?
    >
    > I guess the one thing I'd bring up is that you can comment with the double
    > slash now.


    mixing definitions with statements? bool?
     
    Nick Keighley, Dec 8, 2009
    #6
  7. Frank

    Ike Naar Guest

    In article <>,
    Nick Keighley <> wrote:
    >square(number) /* This is the square function */
    >int number;
    >{
    > int numsq;
    > numsq = number * number; /* This produces the square */
    > sum += numsq;
    >}


    What is "sum"? And why doesn't the function return an int?

    >IMHO this was the biggest mistake C ever made.


    At least they fixed that.

    The next biggest mistake was to name the assignment operator "=",
    and the equality operator "==". And they'll never fix that :-(
     
    Ike Naar, Dec 8, 2009
    #7
  8. On 8 Dec, 11:30, (Ike Naar) wrote:
    > In article <..com>,
    > Nick Keighley  <> wrote:



    > >square(number) /* This is the square function */
    > >int number;
    > >{
    > >   int numsq;
    > >   numsq = number * number; /* This produces the square */
    > >   sum += numsq;
    > >}

    >
    > What is "sum"?


    my fault. I copied the function out of the tutorial (section 5.1) but
    didn't copy:-

    int sum; /* This is a global variable */


    > And why doesn't the function return an int?


    they used implicit int return. They forgot the return statement.

    > >IMHO this was the biggest mistake C ever made.

    >
    > At least they fixed that.
    >
    > The next biggest mistake was to name the assignment operator "=",
    > and the equality operator "==". And they'll never fix that :-(


    then there's the precedence of &. Thye thought about changing that but
    thousands of lines of code already existed...
     
    Nick Keighley, Dec 8, 2009
    #8
    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. Replies:
    1
    Views:
    712
    Juan T. Llibre
    Jan 21, 2005
  2. Mike Barnard
    Replies:
    1
    Views:
    409
  3. Mike Barnard
    Replies:
    0
    Views:
    325
    Mike Barnard
    Sep 7, 2005
  4. Jeff Wagner

    Beginners Tutorial

    Jeff Wagner, Dec 3, 2003, in forum: Python
    Replies:
    0
    Views:
    318
    Jeff Wagner
    Dec 3, 2003
  5. Clodoaldo Pinto

    Programming Tutorial for absolute beginners

    Clodoaldo Pinto, Apr 7, 2006, in forum: Python
    Replies:
    26
    Views:
    966
    Clodoaldo Pinto
    Apr 11, 2006
Loading...

Share This Page