Download presentation
Presentation is loading. Please wait.
Published byEvelyn Green Modified over 9 years ago
1
1 Editing a C Program 01/16/15
2
2 Objective Use Linux to edit, compile and execute a C program
3
3 Login and Password Don’t lose it Keep password a secret
4
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
5 What are two modes in vi? Command Insert
6
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
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
8 Logout exit Right click on desk top Select “leave” Select “logout” button Important
9
9 vim Commands a, i -- Get into insert mode -- 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
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
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
12 Login from Remote Site You can get mobaxterm or other ssh software if you have a PC For Macs see me.
13
13 Engr 213 & 214 Labs for Comp Sci.
14
14 Assignment See the website for assignment. Do program 1 for next Friday, 1/23/15
15
15 Next Week Hardware, software and algorithms Getting Started in C Programming
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.