# I want to learn C programming

Status
Not open for further replies.

#### Maarten

##### New Member
Hello guys,

So I want to get in to C programming, and I looking for a tutorial from zero.
I have been looking around in the forum but did not find it.. ( If there is already a topic please share it and I'll close this one )

So I want to learn the C language.. And I am sure there are people here who can advise me where to start and how the best way is to start from the beginning.

I know I can find a lot of things on Google... But I think its better to get advised from someone who actually went trough such tutorials/guides and advise me the best way..

#### Pommie

##### Well-Known Member
There are lots of online C tutorials. A good starting point might be http://www.learn-c.org/

Mike.
Edit, you don't say why you want to learn C. Learning for PC, microcontrollers and Arduino are all different.

#### rjenkinsgb

##### Well-Known Member
Get an IDE like Codeblocks with a C compiler and debugger.
http://www.ntu.edu.sg/home/ehchua/programming/howto/CodeBlocks_HowTo.html

Start looking at examples of source code and working out what they do and how they work. Then try examples yourself, starting with very simple stuff - "Hello World" etc. (as in the above page) then stuff like this:
https://www.tutorialspoint.com/learn_c_by_examples/simple_programs_in_c.htm

As with many things, the best way to learn is by doing & looking up anything unknown as you go. Using the language and syntax gets it set in to your mind far more effectively than just reading about it and seeing fragments in abstract context.

(For info I'm not advising doing it the way I did, as that was with the K&R C reference book and working with a batch compiler (no interaction, no debugger etc.) on a home built floppy-disc based machine, several decades ago).

The K&R book is now rather old but still useful, though you can find all the same info online.
The book itself appears to be on educational sites so it looks to have been made free:
http://www.dipmat.univpm.it/~demeio/public/the_c_programming_language_2.pdf

#### Maarten

##### New Member
Thanks for the information. I will take now a look at the links you shared.

I also realised after posting that I didn't tell why I want to learn language.. It's because I want to understand the basics of programming, and as far as I know the basics are in C. So when I later want to work on like a arduino or some other microcontroller I will have a basic understanding which will make a lot of things easier...

#### dknguyen

##### Well-Known Member
Thanks for the information. I will take now a look at the links you shared.

I also realised after posting that I didn't tell why I want to learn language.. It's because I want to understand the basics of programming, and as far as I know the basics are in C. So when I later want to work on like a arduino or some other microcontroller I will have a basic understanding which will make a lot of things easier...
You should jump straight to the MCU then.

Do you have $10 to spend on something like a nucleo-32? Doesn't actually need to be plugged into a breadboard to do anything since it has an onboard programmer. You can run it standalone off the onboard USB-programmer. Last edited: #### ronsimpson ##### Well-Known Member Most Helpful Member Which platform are you aiming for? For a general learning of C; use a PC. You have all the hardware you need. #### cowboybob ##### Well-Known Member Most Helpful Member ... You have all the hardware you need. That's true, ron, but for a new user (programmer), instant gratification is a great hook to keep their interest going... Since an Arduino Uno can be had for less than$4.00 USD, and learning to program a PC is initially considerably more difficult to achieve from scratch, I found that getting that LED on the Uno to blink was the hook that kept me interested long enough to actually do something useful .

That was how it was for me, anyway...

#### ronsimpson

##### Well-Known Member
instant gratification is a great hook to keep their interest going
Lets not talk about my love life.

I am using a Raspberry Pi because it has pins and LEDs and it has a keyboard and monitor.
The blinking LED works but then what?
I find debugging in the Pi is easy because I can send variables to the monitor.
The Pi is in the middle land where you can see the LED and you can search the internet for examples on the same computer.
My thoughts.
Ron,

#### dknguyen

##### Well-Known Member
Lets not talk about my love life.

I am using a Raspberry Pi because it has pins and LEDs and it has a keyboard and monitor.
The blinking LED works but then what?
Then UART-DMA buffering for reception and transmission with parsing and command execution so you can send commands to the MCU from a PC through a USB-UART cable. That's very satisfying to type things into the MCU via a PC and see it spit stuff back at you.

A lot of stuff has to work properly to let the MCU handle that while running other tasks.

Status
Not open for further replies.