Computer Science Canada Cartoon Character Helppppp!!!!!!!!!!!!!!!!! |
Author: | ZZK [ Sun Apr 04, 2010 3:45 pm ] | ||
Post subject: | Cartoon Character Helppppp!!!!!!!!!!!!!!!!! | ||
I want to take out alot of the bugs from my program with peoples help and advice? Main issue i want to clear is that i want to know how i can not make the program ever crash, and i want to know how i can keep the things that the people change to my cartoon character.
Turing 1.1.4 |
Author: | andrew. [ Sun Apr 04, 2010 7:58 pm ] | ||
Post subject: | RE:Cartoon Character Helppppp!!!!!!!!!!!!!!!!! | ||
It seems that your program crashes when you type in a string. This happens because you created an integer and Turing cannot store a string in that space. The only way around this (as far as I know) is to use the strintok command. This function will return a boolean value; true if it's okay, and false if it's not. Here's an example:
Basically, use strintok to check if a string can be converted. If not, you can just ignore the input, and if it can, then continue normally. By the way, please update your version of Turing (1.1.4). It is extremely old. Click Turing at the top of this page and you will find a download link for the newest version. |
Author: | TheGuardian001 [ Sun Apr 04, 2010 9:16 pm ] |
Post subject: | Re: RE:Cartoon Character Helppppp!!!!!!!!!!!!!!!!! |
The only way to save changes is to write them to a file. Look into open and close, which are the two main file commands you'll need to know (actually putting things into the file just uses a slightly modified put command.) andrew. @ Sun Apr 04, 2010 7:58 pm wrote: By the way, please update your version of Turing (1.1.4). It is extremely old. Click Turing at the top of this page and you will find a download link for the newest version. Minor correction, get the second newest version (4.1, not 4.1.1a). That way compiling will work, and we might avoid yet another "What the hell does bad object header mean?" thread. |
Author: | andrew. [ Mon Apr 05, 2010 10:18 am ] |
Post subject: | RE:Cartoon Character Helppppp!!!!!!!!!!!!!!!!! |
Here is a tutorial on file input/output. |