These code works perfectly:
#include <ctime>
int main()
{
time_t t;
struct tm* now;
t = time(0); // Here is my attention
now = localtime(&t); // and here
return 0;
}
Now I want to use this as condition in if statement, so I want to do this in one line. I try this code:
now = localtime(&(time(0)));
But I got the error:
E0158 expression must be an lvalue or a function designator
Why I can't call a function inside of another function and use it's result as parameter?
P.S. I'm working in Visual Studio 2017.