I have something like this
char *current_day, *current_time;
system("date +%F);
system("date +%T);
It prints the current day and time in the stdout, but I want to get this output or assign them in current_day and current_time variables, so that I can do some processing with those values later on.
current_day ==> current day
current_time ==> current time
Only solution that I can think of now is direct the output to some file, and then read the file and then assign the values of date and time to current_day and current_time. But I think this is not so good way. Is there any other short and elegant way ?
Hope the problem is clear !!
Thanks.