gettime c

gettime in c: gettime function is used to find current system time. We pass address of a structure varibale of type ( struct time ).

C programming code for gettime
#include<stdio.h>
#include<dos.h>

main()
{
   struct time t;

   gettime(&t);

   printf("Current system time is %d : %d : %d\n",t.ti_hour,t.ti_min,t.ti_sec);

   return 0;
}
Output:

Comments

Popular posts from this blog

Difference between asterisk and ampersand operators in c

kbhit in c