Pages: 1 [2]   Go Down
Author Topic: Why does this work in a .h but not in a .ino?  (Read 1217 times)
0 Members and 1 Guest are viewing this topic.
Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1857
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 497
Posts: 19051
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

And templated functions, as the STL does.
Logged


Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1729
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

~Tom~

Pages: 1 [2]   Go Up
Jump to: