hi,
i m making clock in code blocks C++ but it giving an exception kindly check the given code and help me out as soon as possible
------CODE------
#include
#include
int main()
{
int gd=DETECT;
int gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
time_t rawTime;
struct tm * currentTime;
char a[100];
while(1)
{
rawTime =time(NULL);
currentTime=localtime(&rawTime);
strftime(a,100,"%I:%M:%S",currentTime);
setcolor(11);
settextstyle(3,HORIZ_DIR,10);
outtextxy(200,100,a);
strftime(a,100,"%p",currentTime);
settextstyle(3,HORIZ_DIR,2);
outtextxy(600,8,a);
strftime(a,100,"%a,%d %b,%y",currentTime);
settextstyle(3,HORIZ_DIR,5);
outtextxy(310,130,a);
delay(1000);
}
getch();
closegraph();
}
Krishna Rajput SinghRank #605 · 4K reputationPosted Apr 10, 2016, 2:28 AM EDT
Farhan ShariffRank #2,004 · 725 reputationPosted Jun 2, 2016, 12:11 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts