C Compilation problem

Dear all

I am new to C programming

In response to the post

cat get_time.c

#include <stdlib.h>
#include <sys/time.h>
main()
{
     struct timeval tv;
     struct timezone tz;
     struct tm *tm;
     gettimeofday(&tv, &tz);
     tm=localtime(&tv.tv_sec);
     printf(" %d:%02d:%02d %d \n", tm->tm_hour, tm->tm_min,
              m->tm_sec, tv.tv_usec);
     exit(0);
}

gcc get_time.c

get_time.c: In function `main':
get_time.c:9: warning: assignment makes pointer from integer without a cast
get_time.c:10: error: dereferencing pointer to incomplete type
get_time.c:10: error: dereferencing pointer to incomplete type
get_time.c:11: error: `m' undeclared (first use in this function)
get_time.c:11: error: (Each undeclared identifier is reported only once
get_time.c:11: error: for each function it appears in.)

I am new to C....and really no idea. Please hint me for that.

Many thanks
Valentino

I seem to recall that you need

#include <time.h>

instead of (maybe in addition to)

#include <sys/time.h>

first: you should add the header #include<time.h>
second:you made a little mistake

printf(" %d:%02d:%02d %d \n", tm->tm_hour, tm->tm_min,
              m->tm_sec, tv.tv_usec);

no m was defined,it's tm