Hello,
I have :-
...
char formattedDate[13]="";
time_t tim = time(NULL);
tm *now = localtime(&tim);
sprintf(formattedDate, "%02d/%02d/%d", now->tm_mday, now->tm_mon+1, now->tm_year+1900);
and I'm trying to retrieve the day of the week, i.e. tm_wday
I've tried doing:
...
char currentDay[5]="";
sprintf(currentDay, "%s", now->tm_wday);
...
But this results in a core dump.
Can someone please help ?
Thanks,
Imanuel.


Reply With Quote


Bookmarks