Folowing is a program made in TurboC ,for displaying the system time as a analog clock in the output.Since i was jobless thought id post the code here as well .Nothing much,pretty small toobut just goes to show that reading the tuorials and samples from within the documentation can help u a lot even in turboC.you'll have to use ctrl+break to come out of it.
"You have permission to rip of the follwoing code for use in your programs
" - bosky101
(gee i never thought id reach a stage to say those legal blah blah stuff that u see in all those huge documentaitons and open source projects ..sniff sniff ..well theres always a start )
Code:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<stdlib.h>
#include<dos.h>
int main()
{
clrscr(); [b]//to clear anything else you may have been doing[/b]
struct time *t1; //c++ has this structure made available from dos.h
[B] // or use
//struct dostime_t t; _dos_gettime(&t);
// then use t.hour , t.min , t.sec as values directly[/B]
int gdriver =DETECT,gmode;
initgraph(&gdriver,&gmode,"");
while(1)
{[B]//start infinite loop ,to keep updating time[/B]
gettime(t1);
circle(300,150,100); [B]// the basic clock outline[/B]
printf("The current time is: %2d:%02d:%02d.%02d\n", t1->ti_hour,t1->ti_min,t1->ti_sec); //print time for debugging etc
if ( (t1->ti_hour) >12) {t1->ti_hour=t1->ti_hour-12;} [b]//change from 24 hour scale[/b]
setfillstyle(1,BLUE);[b]//filling color[/b]
pieslice(300,150,(360-(t1->ti_hour*30))+90,(360-(t1->ti_hour*30))+95,40);
setfillstyle(1,RED);
pieslice(300,150,360-(t1->ti_min *6)+90,360-(t1->ti_min*6)+95,80);
pieslice(300,150,360-(t1->ti_sec *6)+90,360-(t1->ti_sec*6)+91,90);
sleep(1);
cleardevice(); [b]//before refreshing the device[/b]
}[b]//end while[/b]
getch();
closegraph();
return 0; [b]// since return type is int[/b]
}

(gee i never thought id reach a stage to say those legal blah blah stuff that u see in all those huge documentaitons and open source projects ..sniff sniff ..well theres always a start )