I need to learn C

Soldato
Joined
29 Jun 2004
Posts
12,957
I need to learn C.

I want to go from writing Hello World to simple programs in C.

What's the best way to learn C?

My experience of programming is scientific computing using FORTRAN and Matlab.

Thank you :)
 
Caporegime
Joined
18 Oct 2002
Posts
32,623
Get a compiler setup and just get cracking. Lots of online resources, find one that you can relate to.

Programming C is not vastly different to fortran IMO, but is quite different to matlab



The first thing to check, do you want to learn C, or C++? People tend to mix and match and put things like C/C++ on their CV. They are very different language,it like saying Java and C are similar - there are similarities and shared syntax but the way the language is used is quite different. Especially if you are coding on an embedded platform or doing things with hardware interrupts etc.
 
Associate
Joined
20 Oct 2007
Posts
776
To elaborate on D.P.'s post, it's like learning to write a book. You can learn where to put the commas, full stops and the meaning of words as well as how to structure a sentence but that's only a small part of it. Programming relies on learning some abstract concepts which are more analogous to plots and characters which is the hard part of learning the language. The syntax can be learnt very quickly but actually learning the rest is the difficult part.
 
Soldato
Joined
2 May 2004
Posts
19,950
I need to learn C.

I want to go from writing Hello World to simple programs in C.

What's the best way to learn C?

My experience of programming is scientific computing using FORTRAN and Matlab.

Thank you :)

Think of something that would be useful to you, a friend or family member and write it.

I personally learn best by having something to write that will actually help me or somebody else. I can't just write code that does random stuff else I get bored/lose interest.
 
Soldato
Joined
2 May 2004
Posts
19,950
Get a copy of Kernighan and Ritchie's "C Programming Language". One of the best programming books ever written.

Looks like a good one, very highly reviewed, however I would recommend maybe borrowing from the library first before investing £30 in something like that. Personally I struggle to learn programming from books, a big part of it being having to look down every 2 minutes, losing the place in the book, holding it open, etc. I much prefer sitting down, plan a project and learn as I go using resources such as official documentation, StackOverflow, Google, dotnetperls (that one isn't relevant in this case though, but still a very good resource), etc.

Maybe that's not the best way to learn. It certainly has caused me some issues before having done something in a way that restricts me from doing something else or making mistakes that might have been pointed out in a book. But, nevermind, I learn from it all. You just need to find your best and most enjoyable way of learning.
 
Back
Top Bottom