struct s
{
char date[100];
}su;
char *formateddate()
{
static char result[100];
time_t t;
t = time(NULL);
strftime(result, sizeof(result), "%Y-%m-%d", localtime(&t));
return result;
}
void main()
{
char *currentDate=formateddate();
printf("%s",currentDate);
//su.date=currentDate;
}
Error: assignment to expression with array type.
I am trying to return current date and store it to the su.date .How can i store it and use further ?