I only want to declare an array of objects of class control
with size of 5. The contents of the specific objects will be filled afterwards.
class control {
public:
control(char* controlName) {
name = controlName;
}
private:
char* name;
};
void setup() {
control humidityControl("humidityControl");
// Problem: Declare an array controlArray with the size of 5 and the name "controlArray"
control controlArray[5]("controlArray"); // Error: no matching function for call to 'control::control()'
control controlArray("controlArray")[5]; // Error: expected ',' or ';' before '[' token
}
void loop() {
}
I'm using C++ on my Arduino. I'd appreciate every tipp how to fix this. Thanks!