Does Arduino use C or C++?

memilanuk picture memilanuk · Aug 5, 2012 · Viewed 114.7k times · Source

Coming from Python, the whole C/C++ thing is kind of alien to begin with... and then I see in one place that Arduino uses 'standard' C, and in another that it uses 'standard' C++, so on and so forth. Which is it? My admittedly crude understanding of the difference between the two is that C++ is (roughly) C with classes/objects. How does that affect which language or dialect (C or C++) should I concentrate on learning for use primarily with Arduino?

Answer

user1157391 picture user1157391 · Aug 5, 2012

Arduino sketches are written in C++.

Here is a typical construct you'll encounter:

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
...
lcd.begin(16, 2);
lcd.print("Hello, World!");

That's C++, not C.

Hence do yourself a favor and learn C++. There are plenty of books and online resources available.