I'm a C# .NET developer.
I need to learn C for embedded systems. Quickly.
Where do I start?
I'm a C# .NET developer.
I need to learn C for embedded systems. Quickly.
Where do I start?
The K&R book is a good place to start.
Being a C# developer and then learning C, I think its a great book. It's step by step with examples that are clear and are easy to understand. It may not get you everything you need to know for what you want to learn, but it definitely is an excellent start.
See senfo's comment below for the errata.
There's no better way to learn than The C Programming Language by K&R. However, you might want to learn assembly as well, especially if you are targeting embedded systems.
two issues here
writing C for embedded systems can be quite different than writing C for systems.
for instance, if you are writing for something like the symbian, you write a style of C that is heavily influenced by the framework/operating system that doesn't look a lot like normal C code.
but, in general, get a book, use the internet.... find a forum specific to the embedded environment you will be using.
Do some experiments on a PC before staring out with embedded systems c is far less strict then C#, it will let you do mistakes that will crush your application and corrupt the running environment without so much as a compiler warming. It will be good for you to do it in the interactive and familiar surrounding of the PC before tackling these problems in a limited embedded system.
These are all online resources.Will definitely help you and save your time.
Specially for Embedded part :
These would suffice.
Since you'll probably be working with a small to non-existant library, you may also want to check out the book Algorithms in C by Robert Sedgewick.
C isn't that hard, you have to first learn C syntax, then u have to move onto microcontrollers. there are many like PIC and AVR Atmel to name a few. good books for C are(as already mentioned above) without doubt the best book for beginners is The C Programming Language by K&R
for microcontroller are(basic books)
Joe Pardue - C Programming for Microcontroller
Programming 8 Bit Microcontroller In C
good luck
I would suggest reverse engineering some code that you have already written. Ensure that the output is in C and you can see how ideas that you have implemented in C# translate to C. I have found this approach to be most effective in my learning.
If you need a tool I recommend Reflector.
A little context would be useful - Do you expect to be writing a production quality app in 3 months, 6 months ? Are you prep-ing for an interview ? Are you writing a CGI module for your home web server ?
The bottom Line is it will take you 3 or 4 projects and 2 years before you are capable of writing a Commercial C app without supervision.
So if that is your situation, my advice is:
Kernighan & Ritchie is obviously the obvious choice. For my money, the book that I end up reaching for when I've got a C question is "C: A Reference Manual" by Harbison & Steele, though.
I would suggest getting the usual books (see the other answers) and possibly acquiring the C99 Standard.
But programming is something you have to actually do, so click here: code-golf. You want questions that have at least 10 upvotes. Solve the questions with the most upvotes first, as they will probably be the ones that have multiple possible and actual solutions.
At a Perl site, code-golf may just be about funny hacks. But here on Stack Overflow, people try out their new language skills, often posting completely uncompressed programs. See this SO answer and this SO answer for why, at least on Stack Overflow, code golf has more value than you might expect, and it certainly provides motivation to think hard...
Some of us, at least, will be watching!