hi all, im having some problem , returning the buffer array to the main function, im new at this , i need to print the currentdate from the main function, is thr any way i can return the date to the main function ??
#include <sys/time.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
char getcurrentdate();
char currentdate[30] = getcurrentdate();
printf("date is%s",currentdate);
}
char getcurrentdate()
{
char buffer[30];
struct timeval tv;
time_t curtime;
gettimeofday(&tv, NULL);
curtime=tv.tv_sec;
strftime(buffer,30,"%d-%m-%y",localtime(&curtime));
printf("%s\n",buffer);
return (*buffer);
}