Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hey guys, I am trying to learn C since well I have enjoyed 'programming' before, (by that I mean vb ) and I am studying through. http://www.faqs.org/docs/learnc/index.html This document has ...
  1. #1
    Linux Newbie Geeth's Avatar
    Join Date
    Apr 2008
    Location
    Brisbane Aus
    Posts
    176

    Learning C

    Hey guys,
    I am trying to learn C since well I have enjoyed 'programming' before, (by that I mean vb ) and I am studying through.

    http://www.faqs.org/docs/learnc/index.html

    This document has heaps of great info, but I think that if I don't apply it to anything that i will just forget it and hate it.

    What I am looking for is sites that have examples and practice exercises so I have something to apply my knowledge to. Sort of like: this is the data from a season of the local sport teams. matches, team names, points scored etc, make a program to sort this data out is blah order. Yes that is something that I will trying to make when I get to it.

    Obviously since I am just starting, basic stuff would be great, esp if it helps build upon previous activities.

    Any help would be much apreciated.

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,279
    Have you looked at everything on that site?
    I see examples there. You should be able to build off of that.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Linux Newbie
    Join Date
    Jul 2008
    Location
    Anaheim, CA
    Posts
    114
    i'm not sure of the difference between GNU C, and the other (i guess proprietary one?) What you learn on one, can you use on the other? (Want to learn C++, though...)

  4. #4
    Linux Newbie Geeth's Avatar
    Join Date
    Apr 2008
    Location
    Brisbane Aus
    Posts
    176
    I was going to try to see what I can do with the examples that are listed there, though I was hoping for other activities to build off of to. Things that I wouldn't have thought of as such.

    Simply these examples are kind of specific to 1 thing i.e loops, or if statements. I am looking for activities that combine it together.

  5. #5
    Just Joined!
    Join Date
    Aug 2008
    Posts
    10
    I would suggest you to start a thread and ask people to test you with questions on c

  6. #6
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Quote Originally Posted by arinlares View Post
    i'm not sure of the difference between GNU C, and the other (i guess proprietary one?) What you learn on one, can you use on the other? (Want to learn C++, though...)
    Both C and C++ have been standardized languages (ANSI/ISO) for some years now and any recent compiler should obey these standards. However, most of them bring about some unique extension and there are more than one revision of these standards.

    Every decent compiler has a "switch" to make him disable his proprietary extension and only behave as the standard says. (Which has only minor effects most of the time.)

    For example, to make sure the GNU C Compiler uses only the ANSI C standard released in 1989 (called C89), one would supply the option switch "-ansi". If your code compiles correctly, it should also be compilable on any other conformant C compiler and behave the same way.

    But as I said before, even with their extension the differences are negligible in most cases, so it doesn't really matter on what compiler you learn. (I recommend, as always, GNU software )

  7. #7
    Linux Newbie Geeth's Avatar
    Join Date
    Apr 2008
    Location
    Brisbane Aus
    Posts
    176
    Quote Originally Posted by GNU-Fan View Post
    (I recommend, as always, GNU software )
    Your name doesn't give that away at all.

  8. #8
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,228
    As you might guess, we get a lot of questions on good ways to learn C. And since I have yet to find a website that satisfies me, I always fall back to this:

    There is a book called The C Programming Language. It is written by Brian Kernighan & Dennis Ritchie. Dennis Ritchie is the creator of the C language. There really is no greater authority on C than this book.

    The book covers ANSI C, beginning at the beginning, and going through lots of cool things. It's a short book, but as they say, C is a short language. They do spend some time towards the back of the book discussing some POSIX-specific functionality (basically, the unistd.h header), which is also interesting.

    There are lots of tasks for the reader, some of which are rather difficult, and though solutions aren't included, you can find them all online.

    This is the book I used to teach myself C, and I really can't recommend it enough.


    Having said all of that, if all that you're looking for are bigger example problems, I suggest re-implementing standard UNIX utilities. Write your own versions of cat, ls, head, tail, cp, mv, etc. Once you've learned enough, write a shell. It's a great way to explore more, and since you're basing it on an existing utility, its easy to make sure it's working correctly.
    DISTRO=Arch
    Registered Linux User #388732

  9. #9
    Linux Newbie Geeth's Avatar
    Join Date
    Apr 2008
    Location
    Brisbane Aus
    Posts
    176
    Thanks Cabhan.
    I will have a look for that book. I think I still have a C for dummies book somewhere. Though I have a feeling its still at the parents place from when I moved out. *Crosses fingers*

    I like the idea though of writting my own commands for practice and making shells.

  10. #10
    Linux Enthusiast
    Join Date
    Oct 2004
    Posts
    609
    There is a difference in learning C or C++.
    Both languages have their own characteristics.

    If you want to learn C++ and do not have any knowledge on C, don't learn C (and I guess that it is the same way around).

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •