Read this before posting a programming question ...

Thanks! And I’ll add the C++ FAQ Lite:

http://www.parashift.com/c++-faq-lite/

Nice.

[quote author=Nick Gammon link=topic=97455.msg786682#msg786682 date=1336426126] Thanks! And I'll add the C++ FAQ Lite:

http://www.parashift.com/c++-faq-lite/ [/quote]

I see there is also: http://www.parashift.com/c++-faq/

The few pages I checked appear identical between the two. :~

Another thing, if the code being posted is not properly indented, it is a pain to follow. Press "tools->auto format" in the IDE first as it makes it far easier to understand :D

maniacbug: Here's my contribution, a collection of common beginner trouble spots: http://www.cprogramming.com/tutorial/common.html

In section 5 of your link, it says that you have to declare the functions first. Why don't I have to do that in Arduino?

Because the Arduino pre-preprocessing does it for you, most of the time. Sometimes, like functions with references as parameters, it doesn't work too well.

AWOL: Sometimes, like functions with references as parameters, it doesn't work too well.

I once did this:

void timer(unsigned long interval, void (*g)()){
  //...
}

and got compiler errors unless I write the function before it is used.

You may also point to this collection of libs: http://arduino.cc/playground/Main/LibraryList

Post your code!

Please change that to “Post your complete sketch!” Too many people post snippets of code that have nothing to do with the actual problem.

Done. I added a clarification that a sketch is a program/code.