Helping Me Learn C: Resources & Tips

In summary, if you want to learn C++ then you should start by reading some short, well-documented programs and google is your friend. If you want to learn C then you should read Kind of like othello. There are only 35 or so key words and a handful of concepts. and start downloading small open source project files. If you want to learn Objective-C then you should use gcc on Linux or unix to compile it and google is your friend.
  • #1
Someone502
40
0
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.

Thanks
 
Computer science news on Phys.org
  • #2
I don't 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?
 
  • #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.
 
  • #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++.
 
  • #5
neurocomp2003 said:
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++.

http://www.parashift.com/c++-faq-lite/how-to-learn-cpp.html#faq-28.2

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.
 
Last edited by a moderator:
  • #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 a lot 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 a lot of books leave out those functions.
 
Last edited:
  • #7
neurocomp2003 said:
yeah but to write optimization code its better to learn C rather than depending always on C++ utility.
Besides in game development you see a lot 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 a lot of books leave out those functions.

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 won't 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).

http://www.toodarkpark.org/computers/objc/

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.
 
Last edited by a moderator:

Related to Helping Me Learn C: Resources & Tips

What are the best resources for learning C?

Some of the best resources for learning C include online tutorials, books, coding websites, and online courses. Popular options include "The C Programming Language" by Brian Kernighan and Dennis Ritchie, "C Programming: A Modern Approach" by K.N. King, and the online tutorial "Learn-C.org".

How can I improve my understanding of C?

To improve your understanding of C, you can practice coding exercises, work on projects, and collaborate with other C programmers. It is also helpful to read through the source code of existing programs written in C to see how other programmers have tackled certain challenges.

Are there any tips for debugging C code?

One tip for debugging C code is to use a debugger tool, such as GDB or LLDB, which allows you to step through your code and track variables. It is also helpful to print out the values of variables at different stages in your program to see where the issue may be occurring.

Is it necessary to have a strong math background to learn C?

While having a strong math background can be helpful in learning C, it is not necessary. Basic math skills, such as understanding arithmetic operations and using variables, are important for programming in any language. However, you can still learn and use C without being a math expert.

What are some common mistakes to avoid when learning C?

Some common mistakes to avoid when learning C include not understanding the basics of pointers, not properly managing memory, and not using proper syntax. It is also important to avoid relying too heavily on online code snippets without fully understanding how they work. Additionally, make sure to regularly test and debug your code to catch any errors or bugs early on.

Similar threads

  • Computing and Technology
Replies
1
Views
1K
  • Computing and Technology
Replies
6
Views
1K
  • Programming and Computer Science
Replies
16
Views
2K
  • Programming and Computer Science
4
Replies
107
Views
5K
Replies
7
Views
1K
  • STEM Academic Advising
Replies
6
Views
1K
  • Programming and Computer Science
Replies
10
Views
2K
  • Computing and Technology
Replies
2
Views
1K
Replies
4
Views
896
Replies
6
Views
893
Back
Top