I have :-
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:
sprintf(currentDay, "%s", now->tm_wday);
But this results in a core dump.
Can someone please help ?