I want to learn C

Posted:
in Genius Bar edited January 2014
I've been wanting to learn C so I can take up Objective-C and write for Mac OS X. I have some REALBasic experiance.



Is there a good book or website that can teach me C?



Thanks.

Comments

  • Reply 1 of 20
    discocowdiscocow Posts: 603member
    I stumbled over a C tutorial over at: <a href="http://www.howstuffworks.com/c.htm"; target="_blank"> how stuff works</a> I?ve read small amount of it but I?m not sure how in depth it goes; the <a href="http://www.howstuffworks.com/c18.htm"; target="_blank"> lots more information</a> page has some decent links.



    As far as books go, have a look at <a href="http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?userid=16Q67RK1PY&sourceid=0036908 6484212890282&bfdate=06%2D09%2D2002+01%3A34%3A45&i sbn=067231861X" target="_blank"> Sams teach yourself C in 24 hours.</a>
  • Reply 2 of 20
    resres Posts: 711member
    For learning C I always recommend Practical C Programing by Steve Oualline. It is published by O'Reilly.



    I'm not sure what books are out for Objective-C, but you can take a look at these sites <a href="http://www.objective-c.org/"; target="_blank">http://www.objective-c.org/</a>;

    <a href="http://www.macdevcenter.com/pub/ct/37"; target="_blank">http://www.macdevcenter.com/pub/ct/37</a>;

    <a href="http://homepage.mac.com/svc/cocoa-objc-mac-os-x/"; target="_blank">http://homepage.mac.com/svc/cocoa-objc-mac-os-x/</a>;
  • Reply 3 of 20
    eugeneeugene Posts: 8,254member
    I second the O'Reilly books suggestions.
  • Reply 4 of 20
    nebagakidnebagakid Posts: 2,692member
    Objective-C and Cocoa programming looks pretty hard.



    I just stick to AppleScript Studio and Interface Builder <img src="graemlins/smokin.gif" border="0" alt="[Chilling]" />
  • Reply 5 of 20
    applenutapplenut Posts: 5,768member
    [quote]Originally posted by Eugene:

    <strong>I second the O'Reilly books suggestions.</strong><hr></blockquote>



    would you say its something that can be accomplished on your own just using the book? or would you say the book is more aimed to be used in addition to a class.





    right now I'm signed up for programming methodology for the summer but I'm most likely gonna swap that for a different class.
  • Reply 6 of 20
    You can't be a C programmer without owning a copy of <a href="http://www.amazon.com/exec/obidos/ASIN/0131103628/qid=1023644590/sr=2-3/ref=sr_2_3/002-2956903-7743238"; target="_blank">this</a>.
  • Reply 7 of 20
    o'o'a'ao'o'a'a Posts: 13member
    [quote]Originally posted by applenut:

    <strong>



    would you say its something that can be accomplished on your own just using the book? </strong><hr></blockquote>



    It depends on how smart you are, and how high your tolerance for frustration is.



    Personally, I probably would have had a very difficult time trying to teach myself programming without any formal classes. It's a lot like learning how to play a musical instrument -- some people have an innate knack for it, but for most people, it's a HUGE help to have at least a few lessons when starting out.



    Anyway, have fun.



    o'o'a'a
  • Reply 8 of 20
    o'o'a'ao'o'a'a Posts: 13member
    [quote]Originally posted by scott_h_phd:

    <strong>You can't be a C programmer without owning a copy of <a href="http://www.amazon.com/exec/obidos/ASIN/0131103628/qid=1023644590/sr=2-3/ref=sr_2_3/002-2956903-7743238"; target="_blank">this</a>.</strong><hr></blockquote>



    I agree -- I'm working through it right now, and it truly is outstanding. If you already know another language pretty well (especially Java, which is similar to C in a lot of ways), you'd do well to get this book.



    However, if you don't have much experience programming, you'd probably be better off with one of the other books mentioned



    o'o'a'a



    [ 06-09-2002: Message edited by: o'o'a'a ]</p>
  • Reply 9 of 20
    stevesteve Posts: 523member
    I've been waiting to find out a bit about C, and you guys sparked my interest with your direction. There is one thing that bugs me though... what the hell is up with the compiler on FreeBSD (or whatever the Unix in OS X is)?



    On a UNIX machine, type gcc samp.c -o samp (if gcc does not work, try cc). This line invokes the C compiler called gcc, asks it to compile samp.c and asks it to place the executable file it creates under the name samp. To run the program, type samp (or, on some UNIX machines, ./samp).



    I did this (and, yes, the file was in my home directory), and it didn't do squat... There isn't even a gcc command!
  • Reply 10 of 20
    eugeneeugene Posts: 8,254member
    GCC is not installed by default. You need get Dev Tools.
  • Reply 11 of 20
    stimulistimuli Posts: 564member
    Which you'll likely have to download from Apple's web site.
  • Reply 12 of 20
    Thanks all. Look like I may be taking some night classes in the future. . .
  • Reply 13 of 20
    splinemodelsplinemodel Posts: 7,311member
    I guess I have to do something new today: agree with Scott.



    I used K&R and then the wonderful Algorithms and Data Structures I, II, and III by Sedgewick (Original C versions). Seem to me to both be pretty good, though you'll have to read over "Algorithms" a lot, sometimes, in order to make sense of Sedgwick's ridiculously truncated code. Of course, sometimes I wonder how useful the data structures are, since Cocoa pretty much gives 'em to ya. Bah. Sometimes you just need to roll your own for SPEED.



    I am a fan of Cocoa because I don't like OO too much. The way objective C approaches it, though, makes it more straightforward to me than the way C++ and Java do it. However, the caveat is that you'll want to get some sort of smalltalk primer if you want to save some time trying to decypher and figure out the syntax of the OO calls in Cocoa.
  • Reply 14 of 20
    rick1138rick1138 Posts: 938member
    Another cool language is steve,the native language of the Breve a-life simulation enviroment-go to spiderland.org if you want to check it out.
  • Reply 15 of 20
    thuh freakthuh freak Posts: 2,664member
    [quote]Originally posted by Nebagakid:

    <strong>Objective-C and Cocoa programming looks pretty hard.</strong><hr></blockquote>



    well, to me objc looked pretty f'n hard too, but once i sat down and actually read the tutorial from apple, it was easy. Writing for Cocoa is just a matter of using the libraries that Apple gives you. I wish objc was more popular outside of macx, so i wouldn't feel like i was using a proprietary language; it would then be my preffered lang.
  • Reply 16 of 20
    o'o'a'ao'o'a'a Posts: 13member
    [quote]Originally posted by Rick1138:

    <strong>go to spiderland.org if you want to check it out.</strong><hr></blockquote>



    Wow...a Slint reference. Now THERE'S a band I haven't heard in looooonggg time. Gawd they were great...



    ah to be 20 agin'...



    *sigh*
  • Reply 17 of 20
    I just checked with our local college. They have an intro to programming class, but it is Fortran!



    I don't think I'm ready to jump right into the C class, but Fortran? Is it worthwhile to to learn the ancient lingua?
  • Reply 18 of 20
    amorphamorph Posts: 7,112member
    [quote]Originally posted by speechgod:

    <strong>I don't think I'm ready to jump right into the C class, but Fortran? Is it worthwhile to to learn the ancient lingua?</strong><hr></blockquote>



    That depends. If you're contemplating physics or engineering, sure. FORTRAN is alive and well among simulation builders.



    If you're not, stay far away from FORTRAN. It's not the best way to learn modern programming concepts (although the latest iteration of the FORTRAN standard isn't that bad - it isn't that widely used, either).



    Really, you'll be hard pressed to do better than Objective-C for learning to program. You just need good books and online references, people to bounce questions off of, and lots of patience. It took me about a year to get really comfortable with C.
  • Reply 19 of 20
    Introductory Programmer:



    Do not learn FORTRAN. FORTRAN is evil. FORTRAN is like learning to drive on a 1950 John Deere. It's the same principle, but it's way harder than it needs to be, and most of it isn't very useful.



    If you want a really simple introduction to programming, go with REALBasic.



    Otherwise, get a "Learn C in 14 Days" book.
  • Reply 20 of 20
    blue2kdaveblue2kdave Posts: 652member
    I am just getting started in C too, and bought the O'Reilly book. Very cool book, but it is now out of print. I discovered this by emailing in a question, and being told the book was no longer supported. CodewarriorU looks pretty interesting, I started one class, but got distracted by life. I amn learning this on my own, and I am almost through the O"reilly book. Its hard at times, but you can do it. Email me if you haveany questions on the O'reilly book.
Sign In or Register to comment.