Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Learning C

  1. May 5, 2005 #1
    First is there a topic with links to learn C.
    Second do i even need to learn C or can i just learn C+ or C++.
    Third is there a place i can learn C.

  2. jcsd
  3. May 5, 2005 #2
    I dont think there is a C+, just a C# and C++. There is not too much support on the NET for C#, atleast if you are into RAD. Why do you want to learn C# or C++ over other languages?
  4. May 5, 2005 #3
    1) This most likely has been covered at some point here. I've partaken in a few C discussions so I know they exist.
    2) No you can go right to C++ if you like. C++ is backwards compatible in many respects.
    3) School/University, KN.King wrote a book called "C A Modern Approach" which is an excellent source, as is http://www.cs.rit.edu/~kar/pointers.on.c/index.html.

    C by itself is easy to learn---Kind of like othello. There are only 35 or so key words and a handful of concepts. It's pretty easy actually. But like othello, C takes a lot of time and practice to master. A good resource is to read through short, well documented, programs. Start downloading small open source project files and read through them. There a a lot of small projects out there, and actually seeing what others do is invaluable.

    Also, google is also your friend in this regard. If you search for C++ or C programming language you'll most certainly find a plethora of information.

    Well, good luck.
  5. May 5, 2005 #4
    its better to learn C first to learn all the little short tricks that C has to offer before dwelling into the OO design of C++.
  6. May 9, 2005 #5

    This link will answer your question exactly.
    However I highly recommend you read the entire page. It will save you quite a lot of time.
  7. May 9, 2005 #6
    yeah but to write optimization code its better to learn C rather than depending always on C++ utility.
    Besides in game development you see alot of C/C++ convention blends...people still use malloc/realloc/memset and printf is so much more friendly then cout. I love to overload operators, and inheritance is a beautiful thing but i still rely on the basic C functions. A good book will teach both but alot of books leave out those functions.
    Last edited: May 9, 2005
  8. May 9, 2005 #7
    Oh c'mon this is not true. You DO NOT have to learn C to optimize code. Now, your point about the games is bcause most games are written in C but use a C++ like interface because game environments include a lot of 'objects'---creatures, textures, halls, pools, guns, etc.

    Someone502 you need to decide what you want to do with your programming knowledge. Many projects (Windows, Linux/BSD kernels, Gnome...) are written in C. Windows GUI has a C++ layer; however, you can still access windows API's using C if you like (C++ is a little easier though IIRC---it's been years since I've done anything on Windows). There are projects out there that are 100% C++ though such as KDE and OpenOffice; moreover, as mentioned above game engine designers usually code in C but engine interfaces are typically OO because of the nature of modern games. If you want to work for Valve or Blizzard then a real good understanding of C++ is a must.

    The thing about C++ is you still have full access to C functions so, if you want to learn C++ then just do that. Learn how to be a good OO programmer. Don't cloud your mind with C idioms or procedural programming styles if OO programming is your goal. You can learn C later if you want.

    If you want to learn C then pretend C++ doesn't even exist.

    A third choice is objective-C. Mostly a Mac OS X language but you can use it on most pretty much any system. gcc can compile objective-c so if you run Linux/unix you wont be left out of all of the fun Mac programmers have (Macs use gcc so it's no surprise that gcc on other systems can compile OC code).


    Anyway, the best plan is to decide---using whatever arbitrary pro's and con's you need to use---which language is best for you i.e. do some research and then learn that language. Don't bother putzing around with learning intermediate languages because you usually add concepts and procedurtal idioms that you will not or cannot use in the language you wanted to leard to begin with.

    As an aside, once you master one language(this takes a long time) then all other languages can be picked up in a matter of minutes or days instead of the weeks or months it will take you to learn the first.

    Good luck.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Learning C
  1. Learning C/C++ (Replies: 5)

  2. Learning C++ (Replies: 9)