Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [FP] 3 Digital clock using Turbo C++
Index -> CompSci.ca, Contests -> [FP] 2004/2005 Archive
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
alpesh




PostPosted: Tue Dec 21, 2004 6:29 am   Post subject: [FP] 3 Digital clock using Turbo C++

Laughing Laughing Laughing
hi... my new digital clock with 3 different type ...



digiclock.c
 Description:
all the best....

Download
 Filename:  digiclock.c
 Filesize:  1.84 KB
 Downloaded:  3104 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Dec 21, 2004 11:31 am   Post subject: (No subject)

shouldn't c++ programs end in .cpp extension?
Hikaru79




PostPosted: Tue Dec 21, 2004 11:32 am   Post subject: (No subject)

Hmm... maybe I just don't know how to compile C right Confused I'm definetly not a C programmer. But I tried compiling this with both g++ and gcc, and I get the following errors:

WITH G++:
code:
adrian@ubuntu:~/Desktop $ g++ digiclock.c
digiclock.c:4:18: conio.h: No such file or directory
digiclock.c:5:16: dos.h: No such file or directory
digiclock.c:6:21: graphics.h: No such file or directory
digiclock.c:9: error: `main' must return `int'
digiclock.c: In function `int main(...)':
digiclock.c:10: error: `DETECT' undeclared (first use this function)
digiclock.c:10: error: (Each undeclared identifier is reported only once for
   each function it appears in.)
digiclock.c:11: error: aggregate `time tt' has incomplete type and cannot be
   defined
digiclock.c:19: error: `clrscr' undeclared (first use this function)
digiclock.c:22: error: `initgraph' undeclared (first use this function)
digiclock.c:23: error: `getmaxy' undeclared (first use this function)
digiclock.c:25: error: `YELLOW' undeclared (first use this function)
digiclock.c:25: error: `setcolor' undeclared (first use this function)
digiclock.c:26: error: `outtextxy' undeclared (first use this function)
/usr/include/stdlib.h:423: error: too many arguments to function `long int
   random()'
digiclock.c:28: error: at this point in file
digiclock.c:29: error: `RED' undeclared (first use this function)
digiclock.c:31: error: `getche' undeclared (first use this function)
/usr/include/stdlib.h:423: error: too many arguments to function `long int
   random()'
digiclock.c:40: error: at this point in file
digiclock.c:44: error: `cleardevice' undeclared (first use this function)
digiclock.c:48: error: `kbhit' undeclared (first use this function)
digiclock.c:51: error: `gettime' undeclared (first use this function)
digiclock.c:54: error: `itoa' undeclared (first use this function)
digiclock.c:58: error: `CYAN' undeclared (first use this function)
digiclock.c:59: error: `GOTHIC_FONT' undeclared (first use this function)
digiclock.c:59: error: `HORIZ_DIR' undeclared (first use this function)
digiclock.c:59: error: `settextstyle' undeclared (first use this function)
digiclock.c:62: error: `WHITE' undeclared (first use this function)
digiclock.c:74: error: `LIGHTBLUE' undeclared (first use this function)
digiclock.c:79: error: `sleep' undeclared (first use this function)
digiclock.c:82: error: `getch' undeclared (first use this function)
digiclock.c:83: error: `closegraph' undeclared (first use this function)


WITH GCC:
code:
adrian@ubuntu:~/Desktop $ gcc digiclock.c
digiclock.c:4:18: conio.h: No such file or directory
digiclock.c:5:16: dos.h: No such file or directory
digiclock.c:6:21: graphics.h: No such file or directory
digiclock.c: In function `main':
digiclock.c:10: error: `DETECT' undeclared (first use in this function)
digiclock.c:10: error: (Each undeclared identifier is reported only once
digiclock.c:10: error: for each function it appears in.)
digiclock.c:11: error: storage size of `tt' isn't known
digiclock.c:25: error: `YELLOW' undeclared (first use in this function)
digiclock.c:28: error: too many arguments to function `random'
digiclock.c:29: error: `RED' undeclared (first use in this function)
digiclock.c:40: error: too many arguments to function `random'
digiclock.c:58: error: `CYAN' undeclared (first use in this function)
digiclock.c:59: error: `GOTHIC_FONT' undeclared (first use in this function)
digiclock.c:59: error: `HORIZ_DIR' undeclared (first use in this function)
digiclock.c:62: error: `WHITE' undeclared (first use in this function)
digiclock.c:74: error: `LIGHTBLUE' undeclared (first use in this function)
digiclock.c:9: warning: return type of `main' is not `int'


Am I doing something wrong? Crying or Very sad
Andy




PostPosted: Tue Dec 21, 2004 2:41 pm   Post subject: (No subject)

hmm there is quite a bit wrong with this... first of all it is c++ code yet he saved it with a .c extension.. second, i dont seem to have the graphics.h header.. but thats prolly cuz im using vc... could u please compile your source code and post the .exe version? o and please also include any odd dynamic link libraries (.dlls)you used
Display posts from previous:   
   Index -> CompSci.ca, Contests -> [FP] 2004/2005 Archive
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: