|
|
"jr" <cre### [at] gmailcom> wrote:
> no C++, but in C I'd create an array of a union of float + bool.
I think for my purposes, c and c++ are similar enough to "be the same".
{GASP!} {Sacrilege!} "Thou hast besmirched the pedantic purity of the names!"}
Could you possibly write a little example of that in C so I can see how it
works?
I also have a hardware address hard-coded into a .h file which prototypes the
functions that interact with the hardware.
The problem I have is that I need at least 2 different sensors, which will have
different addresses once I switch one on the solder pad. I can do a max of 4.
Should I have 4 different .h files?
Should I have 4 differently named constructors IN the .h file?
I'm also confused about the associated .cpp file. That's the one that actually
has the functions defined in it, so how does #include <filename.h> access what's
in filename.cpp if there's no #include <filename.cpp> in filename.h?
Is it just an internal thing to the IDE that automatically includes any
similarly named .cpp file if a .h file is included?
So much to learn. ;)
Post a reply to this message
|
|