|
anyone good at C++ ???
|
View this Thread in Original format
| Ste |
we have made a program which perfectly fine except there is a final if statement which doesnt work when using a basic variable which equals to 0 or 1 depending on he outcome of the game.
however the program doesnt execute the if statement and then dies with an error about 8 digits long and isnt recorded i nthe help files.
we know its the if statement coz we put a while loop which loops a null text string to infinity so we can see that it doesnt execute, and to prevent the program from finishing and crashing. basically when the if statement comes across a value which is not 2 in the variable it uses, it does what i explained. for some reason it works only with the value 2
anyoen got any ideas, the format is correct as we get no errors or warning on compile, and weve tried things such as:
not used the if in a function
used a switch instead
tested the switch before the while loop in the main functon
removed the constant definations (ie. win = 0)
ill try and get the code in a bit.
basically we know where the error is but we cant understand why it is happening coz the code is perfect and we dont understand the error message which only happens when the program completes. |
|
|
| loconet |
| Interesting... What's the exact error message? What compiler? What OS? Yes it will probably help if you either paste the code or link to the source file. |
|
|
| Ste |
| quote: | Originally posted by loconet
Interesting... What's the exact error message? What compiler? What OS? Yes it will probably help if you either paste the code or link to the source file. |
yeh im trying to get the code off the girl in my group who has it, i'll paste it when i can, but basically there error goes something like:
c:\winnt\shell\system32\something.dll something
c:\winnt\shell\system32\somethingelse.dll something
thread caused erorr "random numbers"
program terminated cause of error *8 random numbers* (*8 random hexes*)
thats kinda what its like d have to get back into uni to find it out exact
the compiler is mircosoft visual c++ on windows NT |
|
|
| paranoik0 |
maybe there's something wrong with the space of memory used for the variable.. like you could have changed it without knowing through pointers or something
dunno really, just trying to help |
|
|
| Mr Game+Watch |
| Hmm, instead of using integer values for 0 and 1, have you tried it using boolean values? |
|
|
| Ste |
| quote: | Originally posted by Mr Game+Watch
Hmm, instead of using integer values for 0 and 1, have you tried it using boolean values? |
no because the variable can have 3 values, 0, 1 or 2 |
|
|
| paranoik0 |
| are you using = instead of == ? :p |
|
|
| loconet |
| quote: | Originally posted by paranoik0
are you using = instead of == ? :p |
I was thinkin the same thing :stongue: |
|
|
| AnotherWay83 |
| yeah post the source |
|
|
|
|