Hi:
I need use a class inside a another, I think pass it by reference.
Header file
class Registro {
public:
Registro(uint8_t Largo, uint16_t Capacidad, Time *ClaseTime, uint8_t ID_Registro);
private:
Time * _ObjetoTiempo; // Pointer to store the class pointer.
}
And the cpp file
Registro::Registro (uint8_t Largo, uint16_t Capacidad, Time *ClaseTime, uint8_t ID_Registro) {
_ObjetoTiempo = ClaseTime;
}
And I declare the object in this form:
Time Tiempo();
Registro Registros(5, 100, &Tiempo, 9);
I have this error:
Basico.ino:24:38: error: no matching function for call to ‘Registro::Registro(int, int, Time (*)(), int)’
Registro Registros(5, 100, &Tiempo, 9);
^
Basico.ino:24:38: note: candidates are:
In file included from Basico.ino:22:0:
/usr/share/arduino/libraries/Registro/Registro.h:118:9: note: Registro::Registro(uint8_t, uint16_t, Time*, uint8_t)
Registro(uint8_t Largo, uint16_t Capacidad, Time *ClaseTime, uint8_t ID_Registro);
^
/usr/share/arduino/libraries/Registro/Registro.h:118:9: note: [b]no known conversion for argument 3 from ‘Time (*)()’ to ‘Time*’[/b]
/usr/share/arduino/libraries/Registro/Registro.h:105:7: note: Registro::Registro(const Registro&)
class Registro {
^
/usr/share/arduino/libraries/Registro/Registro.h:105:7: note: candidate expects 1 argument, 4 provided
...
I make several different options but any think work.
Can somebody help me?
Thanks.
Leonel