Hi!
I have just started to work with pelles c but it does not work. After typing a programm like "Hello World" it is not possible to compile the programm and run it as console application. Can somebody help me? Does somebody knows where I could find an instruction manuel about pelles c in the web?
Greetings
Judith
Could you please tell us the error a little bit more precise?
Do you have any error messages?
Or, is it possible, that the program only appears for the part of a secound, because Windows closes the command window after running a console program?
Hi!
That is right, the console window only opens for a few seconds and than close before showing the programm. I don't have any error messenges. Do you know, what I should do against the window closing?
Greetings
Judith
Put
getch();
at the end of your code For example
#include <stdio.h>
#include <conio.h>
#include <string.h>
main()
{
char ch[12];
strcpy( ch, "Hello Judith" );
printf( "Your string is: %s", ch );
getch();
}
Robert Wishlaw
Dear Robert!
Allthough I used your code, with getch() at the end, the project does not work. I typed the code an then compiled it, but nothing happend. Even if I go on the assmeble button (I hope this is the right word), the programm does not work.
Judith
Hello,
just try to compile the program, and then open the program from a cmd-screen. (Start->Execute->cmd.exe, then search for the path with cd c:\path\to\the\file...\, then helloworldorwhatelse.exe)
Do you see your hello world?
try add the following code at the end ( replace getch() ) :
system("pause");
this will pause the console screen & wait for you to press a key
Pause and getch() are unnecessary with Pelles because it does stop at the end of execution.
Pelles-C does not compile directly from sources. You must create a project.
File New Project Empty Projects: Win32 Console Program
File New Project Win32 Application.
Quote from: severach on December 22, 2007, 12:21:11 AM
Pause and getch() are unnecessary with Pelles because it does stop at the end of execution.
If you are running the executable from a file manager, for example Windows Explorer, the command line window of the console program vanishes at the end of the program unless pause or getch() are used. If your program is very short, all you will see, maybe, is a blip.
Robert Wishlaw