user1101
دوشنبه 16 فروردین 1389, 21:25 عصر
یک برنامه برای نشون دادن ساعت نوشتم ، بنظرتون خوبه یا بد
#include "stdio.h"
#include "conio.h"
#include "time.h"
#include "windows.h"
void main()
{
time_t ut;//unix time
char st[81];//string time
struct tm *tp;//time pointer
int x, y;//using as gotoxy function's arguments
while(true)//infinite loop
{
ut = time(NULL);
tp = localtime(&ut);
strftime(st, 80, "%X", tp);
clrscr();
x = 1;
y = 1;
gotoxy(x, y);
puts(st);
while(ut == time(NULL))//determines change of second maximumly in 1/1000 sec
Sleep(1);//delays the execution of code for 1 milisecond
}//end of while(true)
}//end of main function
#include "stdio.h"
#include "conio.h"
#include "time.h"
#include "windows.h"
void main()
{
time_t ut;//unix time
char st[81];//string time
struct tm *tp;//time pointer
int x, y;//using as gotoxy function's arguments
while(true)//infinite loop
{
ut = time(NULL);
tp = localtime(&ut);
strftime(st, 80, "%X", tp);
clrscr();
x = 1;
y = 1;
gotoxy(x, y);
puts(st);
while(ut == time(NULL))//determines change of second maximumly in 1/1000 sec
Sleep(1);//delays the execution of code for 1 milisecond
}//end of while(true)
}//end of main function