Go Down

Topic: Why does this work in a .h but not in a .ino? (Read 1 time) previous topic - next topic

MichaelMeissner


All a header file does is to tell the compiler how code should interact with each other, and to provide some convenience to the programmer.

The code goes into the source files / libraries.


In terms of C++ that is not correct.  You want to put inline functions in the header file so that the compiler can actually inline them.

Nick Gammon

And templated functions, as the STL does.
http://www.gammon.com.au/electronics

Tom Carpenter


In recent versions. You need 1.0.3 onwards for this to work (or maybe 1.0.2, I can't remember right now).

So it doesn't. I've been using 1.5 as I have a Due, I guess I assumed the two would be similar.
~Tom~

Go Up