Read this before posting a programming question ...

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

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

1 Like

Nice.

I see there is also: 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 :smiley:

maniacbug:
Here's my contribution, a collection of common beginner trouble spots: 8 Common Programming Mistakes - Cprogramming.com

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?

1 Like

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.

1 Like

You may also point to this collection of libs: Arduino Playground - 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.