Both work correctly in my simple test code, but I'd like to know if there is any real difference, or any agreed upon preferences in coding styles.
Sample code enclosed:
#include <stdio.h>
#include <time.h>
int main(int argc, char **argv)
{
time_t now1, now2;
time(&now1);
now2 = time(NULL);
printf("now1 = %ld\n", now1);
printf("now2 = %ld\n", now2);
return 0;
}
EDIT
I just saw Keith Thompson's answer - This question should probably be marked as duplicate.