C/C++ Dev-C++ Program Compilation Troubleshooting

AI Thread Summary
When compiling and running a program in Dev-C++, users often encounter an issue where the command prompt opens briefly and then closes immediately. To resolve this, it is suggested to open the command prompt manually by navigating to the program's directory using the 'cd' command and then executing the program by typing its name. Incorporating a function like 'getch()' or 'getchar()' at the end of the code can also help keep the command prompt open until the user decides to close it. This allows for the output to be visible before the window closes.
JamesU
Gold Member
Messages
821
Reaction score
3
Every time I compile and run a program in Dev-C++ Command prompt only opens for less than a second and closes immediately. can anyone help?
 
Technology news on Phys.org
START->RUN

Type: cmd (assuming your on windows xp)
Type: cd <directory where program is located>
Type: <program name>
 
Use getch() ?
Code:
#include<stdio.h>
#include<conio.h>
int main()
{
    printf("Hello World");
    getch();
    return 0;
}

-- AI
 
Programs run until they get to the end of the code, use getchar()
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top