Use a regular text editor (kwrite, gedit, emacs, vi). Source code is just text. Save the file as .cpp and then compile it.
2006-09-16 01:18:55
·
answer #1
·
answered by Anonymous
·
0⤊
0⤋
I don't think you need a cpp extension. A .c extension will suffice. Or maybe the extension is irrelevant. If you use gcc to compile, then it's enough to create a file with emacs and write the program. When done, just type 'gcc anyfile.c myprogram.out.' This will create the executable . I never used g++ but I'm sure it's similar.
Summary: just type emacs myprogram.cpp and this will create a file myprogram.cpp, which you'll be able to compile with g++
2006-09-16 08:17:18
·
answer #2
·
answered by Hesse 3
·
0⤊
0⤋
Any text editor in Linux will work. My recommendation is EMACS, since it will show syntax, IMHO, better than others. You can place the file within any directory you want that you have permissions to, but it is poor practice to use any directory that holds system programs since their could be naming problems that will wreck the system applications. It is good practice anywhere to create directories for projects that will have several files and / or a directory to hold multiple small program files. It should be named with the .cpp extension. Happy programming.
2006-09-16 11:32:55
·
answer #3
·
answered by griz803 5
·
0⤊
0⤋
Usually a basic text editor can be used to create C++ source files.
2006-09-16 08:18:23
·
answer #4
·
answered by Gordo J 2
·
0⤊
0⤋