Using Dev-cpp, a small program compiles but the resultant .exe file
does not run. From the DOS command, it runs. When I try from the
windows run command , it flashes but immediately goes away.
philzz
0
Newbie Poster
Recommended Answers
Jump to PostUsing Dev-cpp, a small program compiles but the resultant .exe file
does not run. From the DOS command, it runs. When I try from the
windows run command , it flashes but immediately goes away.
Jump to Postcin.ignore(cin.rd_buf()->in_avail()); cin.get();
Slap that on the end of the code. This will do the following:
ignore all the available input from the cin (console) input buffer, then grabs a null terminated character (basically waits until you hit enter).
All 6 Replies
VernonDozier
2,218
Posting Expert
Featured Poster
bamabambhole01
0
Newbie Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
u8sand
68
Junior Poster
orwell84
7
Junior Poster
skatamatic
371
Practically a Posting Shark
StuXYZ
commented:
Elegant use of ignore+buffer I hadn't seen before.
+3
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.