Shop OBEX P1 Docs P2 Docs Learn Events
Learning C in 24 pages — Parallax Forums

Learning C in 24 pages

mindrobotsmindrobots Posts: 6,506
edited 2011-11-24 17:54 in Propeller 1
I ran across this little document the other day and thought it put things in an interesting historical perspective and gives a glimpse of C from one of those with the original vision. In light of Ken's blossoming thread about his first program and how to start off learning, I think of this as a little diversion back to our common roots in this great adventure.

From Mr. Brian Kernighan's office at Bell Labs in Murray Hill, NJ, circa 1974, I give you the original internal tutorial on learning this new language C. Everything you need to know to program in C on OS/360, GCOS or UNIX. Now all I need to do is find the "C Reference manual" by some D.M. Ritchie guy written way back in 1974.

Enjoy!

Comments

  • Heater.Heater. Posts: 21,230
    edited 2011-11-16 06:41
    Excellent find.

    To avoid any confusion to beginners it should be pointed out that there are difference between C as presented there and C as it is normally written to modern standards.
    A big one being the way the types of function parameters are specified. In that document we see:
    flip(x, y)
    int *x, *y;
    {
            int temp;
            temp = *x;
            *x = *y;
            *y = temp;
    }
    

    Which would more normally be written as:
    flip(int *x, int *y)
    {
            int temp;
            temp = *x;
            *x = *y;
            *y = temp;
    }
    
    Nowadays. And C++ does not like the old style at all.

    Also that flip function has no return type which will produce a warning on modern compilers.
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-11-16 07:16
    Thanks, Heater.

    I should have added a disclaimer about K&R74 C standards versus current C standards.
  • RonPRonP Posts: 384
    edited 2011-11-18 03:56
    blittled,

    I just paid 80 bucks for that book didn't know you could get it free. No big deal I like hard copy's anyway easier for me to reference.

    Ron
  • Ken GraceyKen Gracey Posts: 7,401
    edited 2011-11-18 07:00
    Perfect starter for me, Mindrobots - thanks for sharing. I'll print it out today and read over vacation.
  • TorTor Posts: 2,010
    edited 2011-11-19 08:08
    Since when did that book get out of copyright?

    -Tor
  • frank freedmanfrank freedman Posts: 1,983
    edited 2011-11-20 06:56
    Tor wrote: »
    Since when did that book get out of copyright?

    -Tor
    Probably is not out of copyright. Probably someone misplaced it where public could access it
  • OppaErichOppaErich Posts: 48
    edited 2011-11-20 08:21
    RonP wrote: »
    I just paid 80 bucks for that book ...
    $80 ? Anyone wanna buy my copy from 1990 plus the solutions book ? They're in German language and have that special smell from collecting smoke for more than one decade though... :smile:
  • __red____red__ Posts: 470
    edited 2011-11-20 08:32
    Probably is not out of copyright. Probably someone misplaced it where public could access it

    Misplaced is generous.

    A Chinese educational establishment distributing copyright material - who'd have thunk it?

    Sorry, I'm just bitter because I've found my own proprietary documents being shared as teaching aids in .cn land.
  • bsnutbsnut Posts: 521
    edited 2011-11-20 10:07
    Ken Gracey wrote: »
    Perfect starter for me, Mindrobots - thanks for sharing.
    I agree with Ken on this and downloaded both. I find C similar to PBasic but with a small twist and it opens other doors.
  • blittledblittled Posts: 681
    edited 2011-11-20 13:08
    Sorry I didn't noticed the .cn extension. I deleted both posts that had links to this page. I do not want to spread illegal copies around,
  • jazzedjazzed Posts: 11,803
    edited 2011-11-20 13:21
    blittled wrote: »
    Sorry I didn't noticed the .cn extension. I deleted both posts that had links to this page. I do not want to spread illegal copies around,
    Thanks.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-11-20 13:56
    The 24-page tutorial is very nice, not just as an introduction to C, but as an object lesson in expository writing. Would that all authors could be so clear and succinct in their presentations!

    -Phil
  • RonPRonP Posts: 384
    edited 2011-11-20 14:11
    The 24-page tutorial is very nice, not just as an introduction to C, but as an object lesson in expository writing. Would that all authors could be so clear and succinct in their presentations!

    The "The C Programming Language(ANSI C)" book is written in the same fashion, they share one of the same author's Brian W. Kernighan. I am very happy with the book, even I am understanding it so far. :smile:

    Ron
  • jazzedjazzed Posts: 11,803
    edited 2011-11-20 15:15
    The 24-page tutorial is very nice, not just as an introduction to C, but as an object lesson in expository writing. Would that all authors could be so clear and succinct in their presentations!

    -Phil
    +1 on that. I particularly like the entertaining way some of the points are driven home at the conclusion of some sections. I also like he way expectations are set to maintain scope. Lots of good detail without looking like a manual.
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-11-20 15:21
    ...much like my "Toggle Tutorials"!

    Well, at least they both deal with C programming.
  • jazzedjazzed Posts: 11,803
    edited 2011-11-20 16:12
    mindrobots wrote: »
    ...much like my "Toggle Tutorials"!

    Well, at least they both deal with C programming.

    BLUSH! :confused:
    Um, ya that's what I was talking about. Right comment, wrong thread.
    This doc is good, but I like your style much better Rick.

    Kick me.
    --Steve
  • potatoheadpotatohead Posts: 10,261
    edited 2011-11-20 16:33
    Thanks for linking. I had never seen it before.

    Agreed on the object lesson writing comments. I'm influenced by this. Great reference.
  • bsnutbsnut Posts: 521
    edited 2011-11-21 01:45
    mindrobots wrote: »
    ...much like my "Toggle Tutorials"!

    Well, at least they both deal with C programming.
    Yes they do. I even downloaded and read it your tutorial and I can say you did a good job with it.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2011-11-21 17:49
    I found a newish K & R in a second hand store for around $12? I had the C pocket reference around first, I think I like it better - http://shop.oreilly.com/product/9780596004361.do
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-11-21 19:33
    > I had the C pocket reference around first, I think I like it better - http://shop.oreilly.com/product/9780596004361.do

    Peter Prinz is also an author for C in a Nutshell... http://books.google.com/books?id=4Mfe4sAMFUYC&printsec=frontcover&source=gbs_ge_summary_r&cad=0#v=onepage&q&f=false
  • BatangBatang Posts: 234
    edited 2011-11-21 23:05
    For anyone wanting to try learn C or just test code etc I would recommend Pelles C for windows.

    http://www.smorgasbordet.com/pellesc/

    Cheers.
  • blittledblittled Posts: 681
    edited 2011-11-23 21:02
    Would "Learning GNU C" be of any interest? The PDF can be found at http://www.nongnu.org/c-prog-book/.
  • jazzedjazzed Posts: 11,803
    edited 2011-11-24 13:23
    blittled wrote: »
    Would "Learning GNU C" be of any interest? The PDF can be found at http://www.nongnu.org/c-prog-book/.
    That's a nice document. Reads like a tutorial with lots of good detailed info.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-11-24 17:54
    I think a sticky thread for C/C++ learning resources would be a good idea.
Sign In or Register to comment.