very stupid question...

sorry for this one guys, but exactly what coding language is the coding behind arduino based on? it looks like c or something close to c to me, but im not sure...

Cheers,
AV

It is c and c++

what do u mean by and... u mean interchangeable or somehow a mix of both (i have never come across a mix of both, unless u mean combined libraries)

C++ is a superset of C, so technically any C++ environment is also a C environment.

-j

C++ is a superset of C. All C code is valid in C++.

Your code gets compiled by a C++ compiler, and you can use C++ constructs on the Arduino. That said most people tend to use the 'C++ as a better C' paradigm.

thanks guys, i always thought that c++ was more of an updated re-release of c which used a different library set and was thus similar yet incompatable... sorta like actionscript 1 and 2... but now i know :slight_smile:

All C code is valid in C++.

Not to be pedantic, but this is not strictly true. Most C code, yes. All, no. There are a few behaviors in C that are not supported in C++. An easy example is that there are new keywords, so in C++ you can no longer write

int old, new;

You also can't perform implicit conversions from void * to other pointers. This used to work in C, for example, but is an error in C++:

char *str = malloc(100);

Mikal

I stand corrected!

"Except for some degenerate cases all C code is valid C++" :wink:

The arduino environment also gives the the ability to combine pure "C" pieces of a sketch with C++ pieces of a sketch, automatically using the correct compiler for each source file.