ANSI C

Hi all

Can I program C code based on ANSI C on the ARDUINO IDE ?

Thanks
Elico

No. It's a C++ compiler. I believe several ANSI C things are not supported in C++.

Yes. If you create a "tab" with a dot-C extension.

Waht is a "tab" ?

Don't you know the appropriate thing to do is to wipe out all evidence of your first post? Or were you just waiting for somebody to quote you first, to add to the confusion? If so, there you go. :wink:

jraskell:
Don't you know the appropriate thing to do is to wipe out all evidence of your first post?

Why would I do that? The question was precise; the expected response would include similar precision. Both responses are correct. The "sketch tab" is not processed by an ANSI C compiler.

Or were you just waiting for somebody to quote you first, to add to the confusion?

What part of my response is confusing? If elico truly wants ANSI C (which was his question) he will not get it from the "sketch tab". If elico truly wants ANSI C from the ARDUINO IDE (which was his question) he can get it from a dot-C tab.

If, instead, elico was seeking a "good C or C++ compiler on the Arduino IDE" then he can state so.

@jraskell: I apologize. Now that I've climbed off my jackbox# I can see my posts are indeed confusing.

@elico: Do you really need an "ANSI C" compiler?

# Like a soapbox but instead of the person standing on the box rambling about politics the person is acting like a jack... Well, you get the idea.

elico:
... based on ANSI C ...

Based on? But not actually C?

What parts of ANSI C are not incorporated into C++? I think his question was more along the lines of, can he tell the compiler to reject C++ features and act as a strict C compiler. I don't believe the Arduino environment can do that. So if that was the question, I think the answer is no.

I'm not sure that was the question. But only OP knows that ...

What parts of ANSI C are not incorporated into C++?

Function declarations / definitions were a problem at my old job.

Legal ANSI but not C++...

noreturntype()
{
}

In ANSI, the declaration does not have to match the definition...

noreturntype();

noreturntype( int whateverdude )
{
}

Hm, I would have to dig into the spec, and maybe this depends upon how on defines "ANSI C", but I don't think those examples are valid C or C+ code. Perhaps they were at one time, but I don't think that's legal syntax today.

Care to place a wager? $) :smiley:

elico:
Waht is a "tab" ?

There is an icon on the top RH corner of the IDE screen. That makes a new "tab" in the project which you can name xxx.c, xxx.cpp, or xxx.h.

Thanks
I am asking this because I wonder if after getting used to ARDUINO ide , will i be able to program
in the AVR STUDIO withot much sweat ..

That is the point .

Elico

Only if you don't get too used to the Arduino supplied libraries.

It's basically C++.

The switch shouldn't be too painful, once you sort out which libraries you are using.