C or C++

Are books on C, or C++ going to be better for helping me advance with the Arduino platform?

C++ subset.

To elaborate on rFree:

  • There is a lot of stuff in C++ for desktop applications that’s not available, or just not useful, in Arduino. If Arduino is your only coding, a C++ book will contain a lot of things that look rather unfamiliar.

  • On the other hand, Arduino makes life a lot easier for us than any standard C program that I’ve ever seen (or inflicted on the world :frowning: ). A C book will contain a lot of detail we don’t really need to go into.

You don’t say whether you’ve programmed anything else. It seems to me that any programming background can help with Arduino. (I’m not a C programmer, but I am a programmer of sorts, and that definitely helped me pick up Arduino quickly) I’d almost suggest learning something different to get a different view of programming structures, if you’re feeling really self motivated.

I’d search for “AVR C programming” on a bookshop site.
There are one or two books in german that cover both the specifics of the Hardware (atmega) used on the Arduino and basic C programming at the same time.

Maybe someone knows a good book in english?

If I want to lookup something on a topic quick, this has been a good source too:

http://en.wikibooks.org/wiki/Subject:C_programming_language
Eberhard

No other programming skills, a total n00b at all things programming…much more comfortable with a soldering iron then a compiler.

Well iv picked up a copy of Sams Teach Yourself C, Sams Teach Yourself C++ and C Programming for Microcontrollers :slight_smile:

So time will tell

Wow, broad spectrum approach :slight_smile: Good luck!

I have a book on Standard C which works very well for my purposes. Some is not relevant to the Arduino but most of it will be relevant.

I would consider a good book on C a requirement if you are going to
develop code or do significant modifications to existing code. If you are going
to do mostly adaptations of existing code you are probably OK without it.

For getting started in C I would get –

The C Programming Language
by Brian W. Kernighan, Dennis M. Ritchie
ISBN-10: 0131103628
ISBN-13: 978-0131103627

A much better reference but a more difficult read is –

C: A Reference Manual
by Samuel P. Harbison, Guy L. Steele
Prentice Hall; ISBN: 0133262243

(* jcl *)

I’d recomment Kelley and Pohl’s “A book on C”
Addison-Wesley Professional; 4 edition (January 8, 1998)
ISBN-10: 0201183994
ISBN-13: 978-0201183993

A much easier read than Kernighan and Ritchie.

Don’t be put off by the thickness - it’s packed with examples and exercises.

I think that it is pretty likely that a book on “modern C++” is likely to focus on pieces of C++ that are neither relevant nor useful on small embedded systems like the Arduino. A lot of C++ programming seems to be about understanding the “standard” classes/libraries/etc for manipulating the typical desktop environment (windows, buttons, files, internet connections…) For arduino, you need a book that talks about the language itself.

I can heartily second the recommendation for Kelley and Pohl’s “A book on C”. I’ve had a copy since about the late 80’s and I still use it occasionally now. Of course you’ll have to ignore all the references to “printf” (sending output to the command line) but Serial.print is a good substitute.

Andrew