You must login to a Linux Computer. To do so you must have a login name and a password. Ask your lab administrator to provide with you with your Login and Password:
The password is not shown as you type it for privacy.Back to top
On Logging in you are presented with a shell prompt:
Now type vi to launch the text editor:
vi is a command mode text editor:
Press i or Insert key to start typing the program.
After you finish typing, Press Esc to leave the insert mode and get back to command mode. Now give the save command :w <filename.cpp>
Now exit the vi editor by giving the quit command :qBack to top
After returning to the shell, compile the program using g++ compiler
rohit@localhost$g++ filename.cppBack to top
On compiling any errors are displayed with line numbers. On successful compilation you can move to the next section.
To edit the source code again, run the vi editor again:
Correct the errors in the program and give the save command :wBack to top
On successful compilation, run the program by running the output file a.out:
./ are required to indicate that the file is in the current directory.Back to top
Once you are satisfied with your program's functioning, you can take its output by running it again and redirecting it to a file:
Now the output of your program is stored in output.txt which you can print or save to a floppy.Back to top
Please see this page first!!
|MingW Compiler - A compiler similar to gcc; for windows||http://www.mingw.org/|
|Msys - A shell similar to linux, allowing you to practice writing an compiling programs||http://www.mingw.org/msys.shtml|
|Knoppix - A Linux distro that runs off the CD without need of installation||http://www.knoppix.org/|
Made By:Rohit Rawat