Pelles C forum

C language => Beginner questions => Topic started by: tconejr on August 17, 2007, 12:40:49 PM

Title: Hello.c
Post by: tconejr on August 17, 2007, 12:40:49 PM
When I double click the EXE created from the Hello.c sample program, the program flashes on screen and then closes.  What's the recommended approach to telling the console window to remain open until the user presses a key?  At my age I'm not quick enough to read the "Hello, world" before the window closes.  :)
Title: Re: Hello.c
Post by: frankie on August 17, 2007, 01:09:20 PM
Wait for a key before to close, to do this add following lines at the end of the function main:
  printf("Press <return> to exit.....");
    getchar();
Title: Re: Hello.c
Post by: tconejr on August 17, 2007, 01:37:07 PM
Thanks!