I'm trying to log reconnections and disconnections of a network. For that I've created 2 time_t
arrays to store such occurances:
const int logSize = 10;
time_t conLog[logSize];
time_t disconLog[logSize];
Now, down the road, I have some manipulation and time calculation to do, and for that I wish to pass those log as a variable.
For example - zeroing its values:
void initLog(time_t log[], time_t init_val = 0)
{
int sizeLog = sizeof(log) / sizeof(log[0]);
Serial.print("size: ");
Serial.println(sizeLog);
for (int i = 0; i < sizeLog; i++)
{
log[i] = init_val;
}
}
in order using it in a simple way : initLog(conLog);
But unfortunately this is wrong.
I've tried to replace time_t log[]
with time_t &log
- but still no luck.
What do I do wrong ?