C constructs for Arduino

Hi,

On the Arduino language reference page (http://arduino.cc/en/Reference/HomePage), I see that there is no info about structs, typedefs, pointers, references, classes, etc.

Yet, it seems that some of these constructs compile ok? or maybe it's just an impression?

Is there a reference page somewhere which clarifies which C and/or C++ constructs are valid in the Arduino compiler?

Thanks,
Bob

The Arduino compiler is gcc - it is a C/C++ compiler.

thanks for the reply.

Are you saying that I can write standard C++ and it will run on the Arduino?

That seems impossible to believe :wink:

Why impossible?
Just don't expect a full PC-like environment, with filesystems and infinite memory.
The Serial and Stream classes mentioned on the reference page use C++ heavily.

Wow! Thanks! I hadn't realized that we could write C++ !!!

I thought that the language was limited to what was given on the reference page...

It never even occurred to me that there could be more stuff beyond... I guess I didn't read enough of the web pages.

Cheers,
Bob

Follow the link from the reference page to the AVR runtime library documentation. There are a few features in that runtime library which are optional and not included by the Arduino when it compiles your sketch, but the vast majority are available to you to use - there is an awful lot of stuff there.

The language used by the IDE IS C/C++. The IDE does a few help full things for you, like providing the main function and adding the dec's of serial depending on the processor type. You could all ways use ATMEL STUDIO from the chip maker which is again C/C++.

Mark

holmes4:
The IDE does a few help full things for you

Translation:

The IDE does some half-baked mucking about with your code before it compiles it

ROLF

Mark

gratefulfrog:
Wow! Thanks! I hadn't realized that we could write C++ !!!

I thought that the language was limited to what was given on the reference page...

It never even occurred to me that there could be more stuff beyond... I guess I didn't read enough of the web pages.

The "Read this before posting a programming question..." sticky at the top of this forum mentions that quite explicitly... at the top of the post.

ROLF

Rolling On Laughing Floor? Or is this some new acronym?

ROLF, Yes, it's a Brit thing 8)

You know, like those extra u's they stick in words :wink: