Every so often I get a private letter asking what's the best way to learn C...
OK... here it comes....
Download and install the latest version of Pelles C. For 64bit Windows you want the x64 version, for everything else you want the x86 version.
Read the help file... No joke, I really mean this...
Read the help file! In there you will find instructions on creating your first project, some general information about the flavour of C Pelle's supports, a lot of detail on the libraries and headers included, detailed information about the IDE and more... Make yourself familiar with the contents so you know where to find things as you need them. This is all stuff you'll need to refer to everyday while working with Pelles C, there's no excuse not to familiarize yourself right up front.
Get a good book on C... There are lots and lots of them. I used
Teach Yourself C in 21 Days by Aitken for an introduction then followed up with
The C Programming Language by Keernighan and Ritchie for more depth.
Know that nobody ever learned C --or any other programming language-- by merely reading a book... and certainly not by watching videos or listening to e-books. To get this to stay between your ears, you need to make a deliberate study... work page by page, re-read as often as necessary... type up all the examples and try all the quizzes... work with the code, change it, break it, fix it.. learn what it can and can't do... Study the text and the code until you understand them and then turn to the next page. And, whatever you do, don't get in a hurry... stay the course if you want to learn.
If you've gotten to the end of your first book, immediately disaffuse yourself of the bright idea that you are suddenly a programmer. Yes you are writing some code and you've done all the exercises in your books but programming is a lot more than simply writing a few algorythms. What you need to do now is
practice and practice and more practice, honing your problem solving skills while writing ever more complex programs... Jumping ahead of your skill level will only frustrate you.
Ok so now you're comfortable writing console programs... lets get on to some Gui stuff...
Download the
Windows SDK (Software Development Kit). In this case you only need to install the Windows API documentation... the rest --headers, libraries, etc-- is already included with Pelles C. The version linked is closest to the Headers and Libs supplied with Pelles C, so you want this version even though there are newer ones.
Yep...
Read the help file... again... This time you are getting familiar with the features of Windows API (Application Programming Interface) and learning to navigate around the SDK's 30,000+ pages. This is like the Pelles C help file, you're going to be in it a lot, so it pays to get familiar with it's content and how to find information when you need it.
Now for a taste of windows GUI mode programming, where everything is a window and you create applications by stacking windows in windows. Grab a copy of
TheForger's Windows API Tutorial and start working through it. Yes, it's all C, and yes, it's unlike any C programming you've seen so far. As before... work page by page, exercise by exercise, repeating as needed until it sinks in. Just like you did with the console mode stuff.
Next, you should get a copy of
Programming Windows by Peltzoid. This is advanced windows, although it is slightly dated. You should once again go page by page, exercise by exercise... just like before.
Of course all the books and tutorials you've accumulated in this process will become valuable reference sources for your future projects.
Ok... so there it is, How to learn C so it sinks in. If you take your time and learn carefully, you will make yourself into an intermediate level programmer... the good stuff all comes from practice, practice and more practice...
A couple of other helpful texts you might want to download...
c99 Information about the C-99 language standards
c11 Information about the C-11 language standards
uxguide Windows user experience guidelines.
EDIT: Cleaned up text, added new links.