Download presentation
Presentation is loading. Please wait.
Published byGarry Peters Modified over 9 years ago
1
1 N305 C Programming
2
2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience leveraging basic data structures ä Get an understanding of simple algorithms
3
3 Agenda ä Environment setup ä Login to Pegasus ä Email ä Introduction to UNIX ä UNIX files and directory structure ä Basic UNIX commands
4
4 Agenda ä How to use a text editor ä emacs editor -- basic commands ä Create and compiler your first C program! ä “Hello world” program ä Compile using “gcc” compiler ä Execute
5
5 Login to UNIX ä User Name ä Oncourse username ä Password ä Oncourse password
6
6 Login (Cont’d) ä ä UNIX is case-sensitive! ä lower-case ä The username and the password are in lower-case ä ä If you are NOT able to logon then: ä ä Contact a Lab Instructor or Course Instructor ä ä Once you login for the first time, the system will prompt you to change the password…create a new password and remember it
7
7 Introduction to UNIX ä UNIX is a multitasking operating system that manages the resources of a computer and provides a user interface. ä UNIX is case sensitive, which means, upper and lower case characters are treated as different characters. ä The UNIX machine for which you are given an account is: pegasus.cs.iupui.edu
8
8 ä A directory is a location to store information. ä UNIX starts with a root directory / /etc /home /usr /bin /jsmith /tjones /local The UNIX Directory Structure
9
9 The UNIX Prompt login: jsmith Password: Last login: Mon Aug 22 08:42:33 from gatekeep.usagrou Sun Microsystems Inc. SunOS 5.8 Generic February 2000 pegasus{jsmith}1: Machine name User name Command number
10
10 Essential UNIX Commands ä ls- list files in present working directory ä pwd- display present working directory ä cd- change directory ä cd.. Backup one directory level ä lp (or lpr) - print file to printer: Printer in SL251! ä rm- remove a file ä cp- copy a file ä mv- move or rename a file ä mkdir- make a directory ä rmdir- remove a directory
11
11 Email ä All email correspondence should take place through Oncourse.
12
12 How to Use Emacs pegasus{jsmith}1:emacs filename ä There is a Tutorial listing the major emacs commands. I suggest you use the Tutorial. ä To use the tutorial, type emacs at the prompt and then type h t. This starts the tutorial. ä Quick Access Card – Linux
13
13 How to Compile A Program pegasus{jsmith}1: gcc first1.c ä C programs end in the “.c” extension ä The executable file is called a.out pegasus{jsmith}1: gcc first1.c
14
14 How to Execute Your Program pegasus{jsmith}1:./a.out ä Type the name of the executable file at the prompt to run your program
15
15 Your First C Program # include # include main(void){ printf(“Hello, CSCI N305!\n”); } Try it!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.