تبليغاتX
آموزش کامپیوتر و برنامه نویسی - نمایش زمان و تاریخ بصورت داینامیک
این وبلاگ جهت آموزش کامپیوتر و برنامه نویسی ایجاد شده است.

به نام خدا

 برنامه ای که در زیر کد آنرا مشاهده می کنید بسیار ساده و تا حدی کاربردی هست . این برنامه بصورت داینامیک زمان و تاریخ را نمایش می دهد که می تواند در اکثر پروژهای دانشگاهی از آن استفاده کرد .

/*
  Name: Dynamic Time and Date
  Copyright: Free
  WebSite : http://cpp.blogfa.com
  Mail : cpp.blogfa@gmail.com
  Author: Pezhman Roudkhaneei
  Date: 29/10/05 11:56 PM
  Description: This Program show Dynamic Current Time
*/

#include
#include
#include
#include

int main(void)
{
   textmode(C80);
   time_t curtime;
// Define a Varible of type time_t.
  
clrscr();      
// for Clear Screen.
  
textcolor(10); 
// Change Text Color into Green .
  
while (!kbhit()){
/* This Loop will Continue until
when press a key of Keyboard. */
  
time(&curtime);  
// For Geting Current Date & Time .
  
gotoxy(1,1);     
// For Change location of the cursor .
  
cprintf("Currnet Date and Time is : %s\n",ctime(&curtime));
   delay(1000);     
// Delay about 1 second.
  
}
   return 0;
}

+ نوشته شده در  یکشنبه بیست و پنجم فروردین 1387ساعت 8:14 بعد از ظهر  توسط مسعود لپه چی  |