A Program Template

Now you might be wondering, "how am I going to remember to do all this stuff every time I need to write a C program?" Well, of course you don't need to. Simply save a copy of the "Hello world!" program somewhere on your hard drive (just click "File->Save as..." and save the file, in the "...\Pelles C\Projects" folder, say) and every time you need to write a simple program, just open this one and modify it. Of course you might want to remove some comments and possibly even the printf line and save it with a different name. This will be your program template.

In order to make a completely new project, you need to do the following. Click on "File->New->Project". Select "Win32 Console program (EXE)" and type a name for your project. Make sure Pelles C sticks this in a directory immediately inside the Projects directory, then click "OK". Now do "File->Open" and locate your template program. Immediately do "File->Save As" and find your new project directory. Save the program there under a different name (usually the same as the name of your project). Now click "Project->Add files to project" and double click the new ".c" file you just created. This will add the file to the project, and you are ready to modify it, compile it and run it.

Normally Pelles C opens up the last project which you were working on. However, should it not come up, you can use the process described earlier for opening the "Hello World!" program, to open up your own project and its associated source file.