Launch error.Can anyone help me with my first program?(I can give you the source code if you want to mess around)Thank you! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Launch error.Can anyone help me with my first program?(I can give you the source code if you want to mess around)Thank you!

I created my first program on my pc using c++ in Microsoft visual studio.The program starts by asking the user to type 2 numbers and then it reveals the addition the multiply and the abstraction of these 2 numbers by pressing the letter x.When I ran the program through local Windows debugger, the program launches as it should, but when I try to launch it by going to the source/repos/"ConsoleApplication1"/debug/ConsoleApplication1, the app apparently crashes as soon as I press the key to do the math.

16th May 2019, 6:36 PM
DRIMITEROS
DRIMITEROS - avatar
8 Answers
+ 1
Hi. As far as I am aware, the debug mode takes over some critical initialisation tasks for you and catches some exceptions. So I am not entirely sure if you can simply run the debug *.exe. Try to build the release version, run it from VS, and then browse to the build *.exe running this one. If this fails I would start an investigation on the code. Cheers.C
16th May 2019, 6:49 PM
ChrA
ChrA - avatar
0
Thank you very much
16th May 2019, 6:55 PM
DRIMITEROS
DRIMITEROS - avatar
0
So on the visual studio I went on tools/options/general/Automatically close the console when debugging stops and I checked it and I saw that the program after running it from local Windows debugger was closing the same way like the finished product was closing.So even thought it was unchecked already the first time, the finished product seems to react like it is checked some how, any ideas?
16th May 2019, 7:25 PM
DRIMITEROS
DRIMITEROS - avatar
0
:-| Hm. Can't tell from here. Sorry but I am to unfamiliar with the options in VS. Would you be okay posting the code?
16th May 2019, 7:36 PM
ChrA
ChrA - avatar
0
You can head on my activities tab, I have posted a picture with the code there
16th May 2019, 7:58 PM
DRIMITEROS
DRIMITEROS - avatar
0
Hmm. Two things about your code on a first glance: * Can you be sure that every input is an integer? * The if clause has no { } scope. So all the commands after the if clause are executed no matter what the user's input will be. Cheers
16th May 2019, 8:11 PM
ChrA
ChrA - avatar
0
Thank you for the advise(it seems like I have a lot room for improvement) 😊
16th May 2019, 8:17 PM
DRIMITEROS
DRIMITEROS - avatar
0
Nae bother. Very few started perfect.
16th May 2019, 8:28 PM
ChrA
ChrA - avatar