C-Free - A Professional Excellent C/C++ IDE |
Build and run single file
C-Free can build single C/C++ file to an executable file. The following steps guide you to edit, build and run a simple program.
1. Start C-Free: double-click on the shortcut of C-Free on desktop, or launch it from "start" menu.
2. Click on the "New File" (Ctrl+N) button on toolbar, a blank edit area appears on the right. Right-click on the edit area to display a popup menu, and choose "Code Template", then "C template" from the menu.
The following codes appear in the edit area:
#include <stdio.h>
int main(int argc, char *argv[])
{
return 0;
}
3. Modify the
codes above: insert one statement before "return 0;":
printf("Hello, C-Free!\n")
then click on the "Save" button on toolbar, save this program as file
named "hello.c". the result is showed below:
4. Click on the "Run" button on toolbar, C-Free begins to build this file. The output information displays on the Message window. Because of the error exists in this program, there is an error message displayed on the Message window. Double-click one message item, the edit area highlights corresponding line in which error exists.
5. Correct the error: Add ";" at the back of "printf" line. "Run" it again, the program is built successfully. The following figure is the result of execution:
You can press any key or click on the "Stop running" button on toolbar to exit from the console.