I want to assign msg.modification_time, but with following codebit I only get "error: request for member 'modification_time' in something not a structure or union". I can't figure out why! Can someone please guide me towards the solution?
Code:
struct meta {
char modification_time[10];
};
void something() {
struct meta *msg = malloc(sizeof(struct meta));
struct timeval tv;
time_t tidNaa;
gettimeofday(&tv, NULL);
tidNaa = tv.tv_sec;
strftime(msg.modification_time,10,"%T",localtime(&tidNaa));
}
Btw: I also tried to declare a char timenow[10] in main, and use strftime(timenow,10,"%T",localtime(&tidNaa));
and that worked. So it is propably the struct that is causing the troubles. What's wrong?