c++ newbie - help debug simple program please
#include <iostream.h>
int main () { int mypin; int brutepin; mypin = 5178; brutepin = 0000; cout << "Trying to match PIN: " << mypin << endl; // go through possibilities for ( brutepin != mypin; brutepin++ ); // final check if ( brutepin == mypin ) { cout << "Successfully found PIN. It was: " << brutepin << endl; } else { cout << "Could not find PIN. Sorry"; } return 0; } |
What errors do you get when you try to compile? Hard to debug a program just by looking at it :)
Edit: nevermind. Your "for" syntax is incorrect. Try this: Code:
for ( ; brutepin != mypin; brutepin++ ); |
I'll give that a whirl. Thanks.
|
Yep. It works. Thanks!
Wow! It figures it out in less than a second! I wonder how long it would take with letters & numbers & *, -, _ etc... That's the next step! |
There's a Cray Y-MP with a guest shell account somewhere on the net... try running it on that :D
|
All times are GMT -5. The time now is 04:40 AM. |