
به وبلاگ آموزش برنامه نویسی خوش آمدید ، برای شما لحظات خوشی را در این وبلاگ آرزو می کنم . این وبلاگ با هدف آموزش برنامه نویسی با تمام زیان ها ایجاد شده است به همین خاطر مطالب این پایگاه گلچینی از بهترین آموزش ها در اینترنت می باشد . من "رضا عبدالملکی " دانشجوی دوره کاردانی رشته کامپیوتر از شهرستان دورود در استان لرستان هستم و منتظر نظرات ، پیشنهادات و انتقادات شما می باشم . موفق و پیروز باشید .




تاريخ ايجاد وبلاگ: شنبه 2 آبان 1388
بروز رساني:چهارشنبه 12 خرداد 1389
تعداد نظرات داده شده : 73 نظر
كل مطالب ارسال شده: 791 عدد
2 . delline : این تابع سبب می شود که خطی که مکان نما (Cursor) در آن قرار دارد حذف شود . برای تفهیم بیشتر به مثال زیر توجه کنید :
#include <stdlib.h>
int main(void)
{
clrscr();
textcolor(12);
cprintf("The function DELLINE deletes the line containing the\r\n");
cprintf("cursor and moves all lines below it one line up.\r\n");
cprintf("DELLINE operates within the currently active text\r\n");
cprintf("window. Press any key to continue . . .");
gotoxy(1,2);
/* Move the cursor to the second line and first column */
getch();
delline();
getch();
return 0;
}
1. clreol : این تابع تمام کاراکترها که بعد از مکان نما قرار دارد را تا آخر آن خط پاک میکند بدون آنکه موقعیت مکان نما تغییر کند . علت اینکه من از تابع cptintf در مثال زیر استفاده کردم این است که توابع clreol - clrscr و getch هر سه در کتابخانه Conio.H هستند و تابع cprintf هم در این کتابخانه است و دیگر از printf استفاده نکردم همچنین یکی دیگر از مزیت های cprintf این است که برای چاپ text های رنگی در خروجی از این تابع استفاده می شود , در حالیکه printf چنین امکانی را در اختیارمان قرار نمی دهد . در زیر مثالی ارائه شده تا مفهوم تابع clreol را بهتر متوجه شوید :
#include <stdlib.h>
{
clrscr();
textcolor(10);
cprintf("The function CLREOL clears all characters from the\r\n");
cprintf("cursor position to the end of the line within the\r\n");
cprintf("current text window, without moving the cursor.\r\n");
cprintf("Press any key to continue . . .");
gotoxy(14,4);
getch();
clreol();
getch();
return 0;
}
Name: Dynamic Time and Date
Copyright: Free
WebSite : http://programming.rasekhblog.com
Mail : r.abdolmaleki@yahoo.com
Author: Reza Abdolmaleki
Description: This Program show Dynamic Current Time
*/
#include <stdio.h>
#include <dos.h>
#include <conio.h>
#include <time.h>
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;
}
