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

Username:   Password: 
 RegisterRegister   
 database program
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
zylum




PostPosted: Sat Mar 13, 2004 6:06 pm   Post subject: database program

this is a program i had to make for my compsci class... it's supposed to by completely bulletproof (can never crash) well here it is... can you guys test it and try to find any way to make it have an error??? (besides integer overflow...)

-zylum



student database.t
 Description:

Download
 Filename:  student database.t
 Filesize:  5.85 KB
 Downloaded:  176 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Sat Mar 13, 2004 6:14 pm   Post subject: (No subject)

Dude...2 things

1) with that much code (200+ lines), attatch a file...
2) you didn't even trap Ctrl+Z!

Well, seeing as you asked for bugs, there you are.
zylum




PostPosted: Sat Mar 13, 2004 6:17 pm   Post subject: (No subject)

what do you mean trap ctrl-z?
Tony




PostPosted: Sat Mar 13, 2004 6:29 pm   Post subject: (No subject)

it appears that Ctrl+Z messes up your case (attempt to read pass EOF)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
zylum




PostPosted: Sat Mar 13, 2004 6:35 pm   Post subject: (No subject)

hmm... how do i prevent this???
Delos




PostPosted: Sat Mar 13, 2004 6:49 pm   Post subject: (No subject)

Oh...boy...

You're talking about uncrashibility, and you've never heard of Ctrl-Z...

Ok...

Back in ClassicTuring, there existed 2 keys: Ctrl+C, and Ctrl+Z.
Ctrl+C was the auto-breaker, that paused a proggie...even in exe format.
Ctrl+Z was the eof denoter, which would crash most every prog, except the really well written ones, but even in those it would cause it to end.
Those were the most difficult keys to trap.

Fast forward to WinOOT.
Introduce the getch command. Back in Classic, the getch command would die w/ Ctrl+Z. But, in WinOOT, where the whole DOS-like idea of eoffing out of a prog is far less common, getch handles Ctrl+Z as Ctrl+Z, not eof.
get still dies with it though.

So...to answer your question.
Set up a getch-based input, from which you can pass results to a verifying procedure (that can check for strintoks etc), which then passes a result back to the programme to be carried forth.

Nothing beyond your capabilities, I'd say.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: