Editing Files: C/C++ Editor

Editing a file

Enter the following simple C source in your new source document (the code deliberately contains a mistake, which you will correct later on):

#include <stdio.h>

int main( void )
{
    printf( "Hello World\n" )  	 /* <- missing semicolon */
}

Note the following:

Saving and closing a file

To save the file:

To close the file:

Notice also the menu commands Save All and Close All Editors which you can use when you are working with multiple files.

Opening a file in the C/C++ editor

There are several ways to open an existing file. An easy way to open the C source file myfile.c directly in the C/C++ editor is:

Opening a file in a system editor

If you want to open a C source file in an application (editor) outside Eclipse (instead of the built-in C/C++ editor), proceed as follows: