You can use any editor like vi or emacs, or any XWindow editors, in order to create a C or C++ program(If you know the syntax).
Let us take that you have named it as simple.c, then you must enter
gcc simple.c -o simple
in order to use the complier. Here, the -o option is for giving a name to the resultant binary file.