Error : Dereferencing pointer to incomplete type

Discussion in 'Mac Programming' started by mkristain, Aug 22, 2011.

  1. mkristain macrumors regular

    Joined:
    Aug 18, 2011
    #1
    this error occurred here

    Code:
    struct tm		*tm_p;
          tm_p = localtime(&current_file->stat.st_mtime);
    
          snprintf(datestr, sizeof(datestr),"%2d-%s-%4d %02d:%02d",
    	  tm_p->tm_mday, monstr[tm_p->tm_mon], 
    	  1900 + tm_p->tm_year, tm_p->tm_hour,
    	  tm_p->tm_min);
    
    
    please help me to resolve this.
     
  2. foidulus macrumors 6502a

    Joined:
    Jan 15, 2007
    #2

    Are you including time.h?

    #include <time.h>

    if not, you will get that error.
     
  3. mkristain thread starter macrumors regular

    Joined:
    Aug 18, 2011

Share This Page