Editing a C Program - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Editing a C Program

Description:

... into onyx Edit the program using vi or vim Compile the program with gcc Execute the program with a.out Logout out of onyx Two Modes in vim Command Insert vim ... – PowerPoint PPT presentation

Number of Views:95
Avg rating:3.0/5.0
Slides: 16
Provided by: bois55
Learn more at: http://cs.boisestate.edu
Category:
Tags: editing | onyx | program

less

Transcript and Presenter's Notes

Title: Editing a C Program


1
Editing a C Program
  • 01/15/16

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

3
Login and Password
  • Dont 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
Two Modes in vim
  • 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
  • Compile the program.
  • If there are errors, correct and recompile.
  • a.out
  • Executes the program

8
Logout
  • exit
  • Right click on desk top
  • Select leave
  • Select logout button
  • Important

9
vim Commands
  • a, i -- Get into insert mode
  • ltescgt -- 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.
  • r replace
  • n move cursor to line n
  • You should know the commands in the vimtutor,
    Lessons 1 through 3

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
Engr 213 214
  • Labs for Comp Sci.

14
Assignment
  • See the website for assignment.

15
Next Week
  • Getting Started in C Programming
Write a Comment
User Comments (0)
About PowerShow.com