I would like to use tm struct as a static variable in the class. He spent the whole day reading and trying, but he still canβt work :( I would understand if someone could indicate what I was doing wrong.
In my class under Public, I declared it as:
static struct tm *dataTime;
In main.cpp, I tried to define and initialize it with the system time for checking (actual time for input at runtime)
time_t rawTime; time ( &rawTime ); tm Indice::dataTime = localtime(&rawTime);
but it looks like I cannot use the external time () functions.
main.cpp: 28: error: constructor, destructor, or type conversion to 'expected (token)
How to initialize values ββin a static tm class?
c ++ struct static class ctime
eruina
source share