baumann@pan <ba*********@gmail.comwrote:
Hi,
i write
static time_t current_time = time();
The time function should be called with a pointer to a time_t object or
NULL:
time_t time(time_t *tloc);
Fix that first...
>
but the gcc compiler complains:
error: initializer element is not constant.
I want to know
1, why,
2, and how to resovle it.
thanks.
.... then (n1124.pdf) 6.7.8-4: "All the expressions in an initializer for an
object that has static storage duration shall be constant expressions or
string literal."
In your case it's a function call.
--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)