Programming in C and using serial monitor

I am doing a project on an ATtiny85 and will be programming in C. If possible I would like to do the program with the arduino and use the serial monitor to see output. Once I am happy with it I would move onto the ATtiny85. Is it possible to program the arduino directly in C and still be able to make use of the serial monitor.

For example I would like to run this code:

/* Hello World program */

#include<stdio.h>

main()
{
printf("Hello World");

}

but use the serial monitor instead of printf.

Is it possible to program the arduino directly in C

Yes, although there is no benefit to be gained.

and use the serial monitor to see output.

Yes. Getting the ATTiny85 to write to the serial pins is not going to be easy though, since the ATTin85 doesn't have serial pins. You use SoftwareSerial and any two pins, but SoftwareSerial is a class, and classes are not part of C.

Sorry what I mean is I would like to develop the program in C using the arduino (so that I can take advantage of the serial monitor for reading values) and then because it is in C, once I know that it works put it on the ATtiny85 (removing all the Serial monitor elements, I just want to use it to aid development and debugging). The code above is just an example.

The normal Arduino language is C++. What advantage do you see in using C ?

...R

Can you just type C++ in the arduino ide? For example if I just typed the C++ examples from a C++ book as it says in the book would it work?

gummy:
Can you just type C++ in the arduino ide?

All Arduino programs are standard C++

...R

How come it say's error compiling if I type this in:

#include

using namespace std;

int main()
{
cout << "Hello World\n";
return 0;
}

How would I get that to run?

Many thanks

How come it say's error compiling if I type this in:

All Arduino programs are C++.

NOT all C++ programs are Arduino programs. Hold your Arduino up. Can you point to the stdout device? I didn't think so.

gummy:
How would I get that to run?

Put your code in loop()

In the Arduino system the main() function is hidden and it calls setup() once and then calls loop() repeatedly for ever. In other words the housekeeping is being done for you.

...R