SEARCH

The How-To Geek Forums Have Migrated to Discourse

How-To Geek Forums / Geek Stuff

Easy, FUNNY C++ programming books?

(56 posts)
  • Started 6 years ago by chustar
  • Latest reply from jack7h3r1pp3r
  • Topic Viewed 4449 times

Lighthouse
Lighthouse
Posts: 13598

exe files in general?

Posted 6 years ago
Top
 
jack7h3r1pp3r
jack7h3r1pp3r
Posts: 2815

no just the ones that i program in c++ they are the ones in the pdf that whs posted

Posted 6 years ago
Top
 
Lighthouse
Lighthouse
Posts: 13598

If you open them in a "dos box" you might get more info

Posted 6 years ago
Top
 
jack7h3r1pp3r
jack7h3r1pp3r
Posts: 2815

how do you do this exactly

edit: and i was kinda just wundering why they did this and will they do this when i get farther into c++

Posted 6 years ago
Top
 
Lighthouse
Lighthouse
Posts: 13598

Open up a command prompt (dos box) and run your exe from there

Posted 6 years ago
Top
 
jack7h3r1pp3r
jack7h3r1pp3r
Posts: 2815

that is what they normally run in

edit: also what is the comand to run in cmd

Posted 6 years ago
Top
 
Lighthouse
Lighthouse
Posts: 13598

do you mean Win+R cmd

Posted 6 years ago
Top
 
whs
whs
Posts: 17584

jack, Hit Start > type CMD > right click cmd above > run as administrator

Posted 6 years ago
Top
 
jack7h3r1pp3r
jack7h3r1pp3r
Posts: 2815

no what i meant is how do i run the .exe in command prompt what is that command

Posted 6 years ago
Top
 
Smashpmk712
Smashpmk712
Posts: 313

navigate to the directory that the file lives in and type in the file name (I.E. test.exe)

Posted 6 years ago
Top
 
jack7h3r1pp3r
jack7h3r1pp3r
Posts: 2815

@smash that really helped thx

Posted 6 years ago
Top
 
Smashpmk712
Smashpmk712
Posts: 313

no problem. that will work for almost any file ... Just wondering, why didn't you double click it in windows explorer(My computer)?

Posted 6 years ago
Top
 
jack7h3r1pp3r
jack7h3r1pp3r
Posts: 2815

when i run and i push enter to give me the answer for the program it shuts the box right away

Posted 6 years ago
Top
 
pipo
pipo
Posts: 428

did you put a return statement at the end of your code? from what i can remember from my c++ days, the return statement adds the 'Press any key to continue' at the end of your running program (somebody correct me if i'm wrong, please).

or a workaround that you can do is to accept a user input at the end of your code, this would, sort of, stop your program from running until you input anything.

Posted 6 years ago
Top
 
jack7h3r1pp3r
jack7h3r1pp3r
Posts: 2815

i don't think it is the return thing since i have tried that but it was still the same

edit: would any one happen to know a code to say push enter to exit and then exit the program in c++

because that would kinda fix the problem and it seems easy enough to do

Posted 6 years ago
Top
 
jack7h3r1pp3r
jack7h3r1pp3r
Posts: 2815

ok i have figured this one out already

i anyone wants to know the source code here it is

cin.get();
cin.ignore();

return 0;

Posted 6 years ago
Top
 



Topic Closed

This topic has been closed to new replies.

Enter Your Email Here to Get Access for Free:

Go check your email!