Hello friends,
So i guess for many of you this will be basic stuff. I have ideas how to do it, but i wanna learn it the "right way".
First the facts. Lets say i have a class:
class GsmInput
{
public:
String phoneNr1;
String phoneNr2;
String phoneNr3;
String message1;
String message2;
String smsStatus;
bool smsStatusForFunction;
bool dataWasSend = false;
private:
};
with a defined object:
GsmInput Testobject;
Now i wanna build a "watchdog" function (that will be in my loop), that will do stuff, depending on the value of bool smsStatusForFunction. This value will change from time to time.
So i was always very lazy with pointers and avoided them. But from what i read, this is the time, where i should use pointers and start to learn. True?
Lets say i will build my watchdog function and do it step by step:
Would this be correct?
byte watchdog (Testobject *vari1) //My agrument is a pointer with type of class
{
testpointer* vari1 = Testobject smsStatusForFunction; //Pointer points to value of classmember
byte value;
if( testpointer* vari1 == 1){ //Since the pointer points to the value i can operate on them
//do stuff
byte = 3;
return byte;
}
}
Is it complety stupid what i do?
Thank you very much