K&R is doing my head in!

This is a discussion on K&R is doing my head in! within the C Programming forums, part of the General Programming Boards category; Hi, I spent a few months programming with Delphi and enjoyed it, but found it too restrictive; ultimately I would ...

  1. #1
    Unregistered
    Guest

    K&R is doing my head in!

    Hi, I spent a few months programming with Delphi and enjoyed it, but found it too restrictive; ultimately I would like to program in C++. So on the advice of this website and others I went out and bought Kernighan & Ritchie's 'The C Programming Language'. Now I feel I've hit a brick wall. Why is this book so strongly recommended? I just can't get my head around those functions, and find the exercises impossible. It's made me think maybe I'm just not cut out for C. Has anyone else felt the same and if so how did you overcome it? I'm thinking of just forgetting about the exercises and reading the whole thing from cover to cover and then getting stuck straight into C++ with a book like Teach Yourself C++ in 21 Days. Any feedback would be greatly appreciated.

    Thanks,

    Matthew

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Could you be more specific on the topics you are having trouble with. You already have programming ecperience so you are aware of variables,loops,assignments etc. so it is just a case of learning a new syntax.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    591

    Barjor

    I think we all feal the same from time to time. I am reading Strostrup(sp) right now and I get the same fealing .I liked the C++ in 21 days but the title should be more like C++ in 21 weeks if you start to learn from scratch. C and C++ are not easy languages to learn ,it is not a 2 week process, Just don't give up.

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    I am reading Strostrup(sp) right now and I get the same fealing
    Same for most of us m8! that book is good but it is more than a little cryptic in places.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  5. #5
    Sayeh
    Guest
    First of all, instead of just trying to learn something and walking through the book, why don't you think of something you want to do.

    I find I learn something better if I pick a goal and work toward it. In this case, maybe I want to write a program to build mazes, or text-based space-invaders, or something.

    Give yourself something to work toward, so your mind is trying to solve "real" problems. Then only learn enough of the language to answer the questions you have. As you go along, you will learn more of the language than you need, and you will see other things.

    This way, you're not overwhelming yourself.

    enjoy.

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    K&R is a wonderful book if you already know C, but I wouldn't reccomend it for anyone to learn the language from.

    Actually, I'm pretty sure that the intent of the book is to teach people who are already experienced in programming, the C language. K&R does not teach programming.
    Callou collei we'll code the way
    Of prime numbers and pings!

  7. #7
    Registered User
    Join Date
    Nov 2001
    Posts
    23
    I faced the same problem as you i.e. "not cut out for C"

    In actual fact I did not major in software in uni and still managed to get a job as a programmer... I sometimes wonder whether that was a good or bad thing. I had a rather hard time... the boss was thinking I was some kind of software genius

    Also, in my first job as a programmer I was also learning C with embedded SQL... talk about going at warp speed

    it's true that K&R is more for those who already know C

    I haven't any good advice except... hang in there, you'll probably get a hang out of it... eventually

    all the best

  8. #8
    Registered User
    Join Date
    Nov 2001
    Posts
    23
    alternatively, try looking for other books at the nearest library

    I came across a book on Microsoft Quick C, I thought it was pretty good, try looking for it

    I always felt that pointers is very important, so is arrays and then structs, in that order if you may

  9. #9
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    K&R is good if you are already comfortable with programming, but it's most useful to experienced coders as a reference book. If you want to learn C in a relatively simple and understandable way, pick up Pointers on C by Kenneth Reek. It's a very good book that addresses basic and intermediate parts of C; I've found it to be very thorough and easy to understand.

    Though having a project that you want to do will speed your learning as Sayeh said.

    -Prelude
    My best code is written with the delete key.

  10. #10
    Unregistered
    Guest

    Thanks

    Thanks for the feedback everyone. I got so used to the drag and drop world of Delphi I didn't realise how much I still have to learn about programming. K&R is NOT a good book if you are in that position. I agree that working through your own project is the best way to learn. Also I had a look at some open source code that I was actually interested in and that has helped me understand functions better and how they interact with the main program. I'll check out the recommended books too. Thanks again.

    Matthew

  11. #11
    Registered User
    Join Date
    Feb 2002
    Posts
    9

    answer


    the first i had brought the book i thougth that i will never learn c in my life,and i switched to let us c by yeshwanth kanetkar and then when i switched to k&r i am feeling comfortable with it and and i had read almost whole book.basically as k&r has pointed out in the preface part it is not a tutorial book it assumes that yor are familar with some of the programming langauags

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Looking for a way to store listbox data
    By Welder in forum C Programming
    Replies: 20
    Last Post: 11-01-2007, 11:48 PM
  2. Cant head insert on doubly linked list
    By aciarlillo in forum C++ Programming
    Replies: 4
    Last Post: 09-18-2005, 11:31 AM
  3. Can't figure out problem with code
    By Beast() in forum C Programming
    Replies: 4
    Last Post: 04-16-2005, 05:27 PM
  4. Linked List Help
    By Perverse in forum C++ Programming
    Replies: 3
    Last Post: 02-22-2005, 07:33 AM
  5. change stack to a queue
    By sballew in forum C Programming
    Replies: 12
    Last Post: 12-03-2001, 10:16 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21