I have defined a struct, but cannot define a function with that type as parameter:
error: 'ALARM' was not declared in this scope In function 'boolean CheckAlarm(ALARM*)':
Bad error line: -2
I see in the Playground and in other (older) posts that the suggestion/solution is to move the struct definition to another file. (or the function too maybe?)
If that's the solution...
But can anybody post me a simple example on that.
I get alot of errors because byte is not defined when the struct is located in the separate file.
Can I just include some file in the .h file or ...?
I'm new to C structs and am having some problems with this concept. The code examples above aren't complete enough for me to understand.
I'm trying to declare a structure that can be used to hold the results of an operation.
This code works, but it hard codes the structure into the function. I want to be able to pass multiple instances of the structure into the function via a pointer. Ideally, I'd be able to have multiple instances of my structure using something like:
MyStructureType new_struct;
And then pass that newly initialized struct to the function.
The code did not compile for me. I got the following errors:
Tried a few things to fix it but failed... ??
etch_oct05c:-1: error: variable or field 'do_something' declared void
sketch_oct05c:-1: error: 'ctlrResults_t' was not declared in this scope
sketch_oct05c:-1: error: 'r' was not declared in this scope
sketch_oct05c:0: error: expected constructor, destructor, or type conversion before 'struct'
sketch_oct05c:4: error: expected constructor, destructor, or type conversion before ';' token
sketch_oct05c:6: error: 'ctlrResults_t' does not name a type
sketch_oct05c:7: error: variable or field 'do_something' declared void
sketch_oct05c:7: error: 'ctlrResults_t' was not declared in this scope
sketch_oct05c:7: error: 'r' was not declared in this scope
sketch_oct05c.cpp: In function 'void setup()':
sketch_oct05c:10: error: 'ctlrResults' was not declared in this scope
sketch_oct05c:10: error: 'do_something' was not declared in this scope
sketch_oct05c.cpp: At global scope:
sketch_oct05c:19: error: variable or field 'do_something' declared void
sketch_oct05c:19: error: 'ctlrResults_t' was not declared in this scope
sketch_oct05c:19: error: 'r' was not declared in this scope