exe. Does Not Run Properly Every Time

Hello :D

I made a console app in Visual Studio C++ 2010. When I run the .exe it opens, but the app does not function like it should. It only works when I reopen it a several times. I tried compiling in DEV C++ and I didn't get any problems. Why is this not happening in Visual Studio?

Thanks for any help,

Muhasaresa
Last edited on
Hello, Muhasaresa.

Can you specify what happens when you execute the console? A console shouldn't act like that.
OK :D

I made an encryptor that can encrypt and decrypt text.

The encryptor works fine every time no problem, but the DECRYPTOR only works properly on a rare occasion. The problem is that it only seems to decrypt the first letter instead of the whole string. Even when i try decrypting exactly the same code, it only works sometimes. But when I use Dev C++ there is never a problem (exactly the same C++ code).

I just don't understand how a simple .exe works sometimes and other times it doesn't.

Thanks for the help :D

Muhasaresa

Last edited on
closed account (1vRz3TCk)
Post the code, we may be able to help, else it would be pure guesswork.
I think I might have located the source of the problem:

There might be something wrong with this part of the code:

1
2
3
4
5
6

int o;
string intercon;

if (intercon == "128" || intercon == "100") {o = 3; cout <<"test";}
      else  {o = 2;}


This is quite an important part of the code. When I tested it out to see if the statements actually worked by putting in cout <<"test"; I found out that even if "intercon" was "128" or "100", "test" was never couted out, which probably means int o was not turned into 3.

THanks for the help,

Muhasaresa :D
Last edited on
Topic archived. No new replies allowed.