1 / 16

Editing a C Program

Editing a C Program. 01/24/14. Objective. Use Linux to edit, compile and execute a C program. Login and Password. Don’t lose it Keep password a secret. Steps to Run a C program. Login into onyx Edit the program using vi or vim Compile the program with gcc

dexter
Download Presentation

Editing a C Program

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Editing a C Program 01/24/14

  2. Objective Use Linux to edit, compile and execute a C program

  3. Login and Password Don’t lose it Keep password a secret

  4. Steps to Run a C program Login into onyx Edit the program using vi or vim Compile the program with gcc Execute the program with a.out Logout out of onyx

  5. What are two modes in vi? Command Insert

  6. vim I want to write a program whose output is: Martin Luther King said: I have a dream. I will write a C program to do that. I will use the vim editor to create the program.

  7. To Execute a Program vim prog.c Edit the program Save with :wq gcc prog.c If there are errors, correct and recompile. a.out

  8. Logout exit Right click on desk top Select “leave” Select “logout” button Important

  9. vim Commands a, i -- Get into insert mode <esc> -- Get back to command mode x -- delete a character dd -- delete a line p -- paste u -- undo :wq -- write and quit :q! -- quit without saving. arrow keys -- move around

  10. More vim Commands 3x -- Number makes command happen that many times. p - put (paste) r – replace G You should know the commands in the vimtutor, 1.1 to 4.1

  11. More Linux Command Format command -options arguments Commands to know: ls, lpr, cp , rm, mv, mkdir, mv(to a directory), cd, cd .., rmdir man, more, cat exit

  12. Login from Remote Site You can get mobaxterm or other ssh software if you have a PC For Macs see me.

  13. Login from Remote Site You can get mobaxterm or other ssh software if you have a PC For Macs see me.

  14. ET214 & ET213 Labs for Comp Sci.

  15. Assignment See the website for assignment. Do program 1 for next Friday, 1/31/14

  16. Next Week Hardware, software and algorithms Getting Started in C Programming

More Related