Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.

Similar presentations


Presentation on theme: "1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience."— Presentation transcript:

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 Class E-mail Subscription ä Subscribe to the class email to receive mail sent to the entire class by instructors and other classmates ä Send mail to: majordomo@cs.iupui.edu majordomo@cs.iupui.edu ä Subject: blank ä Body of Message: subscribe n305

13 13 Pine ä ä You can practice subscribing from unix, but you should subscribe from whatever email account you use most during the day or the email you want to receive emergency notifications. ä pine ä From the unix prompt type pine ä ä The system will indicate the welcome message for the first time ä ä Type c to compose a mail ä ä Write majordomo@cs.iupui.edu in the To field ä ä Leave the Subject field blank ä ä Type subscribe n305 below Message Text ä ä Type control x to send the mail ä ä Type q to quit

14 14 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

15 15 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

16 16 How to Execute Your Program pegasus{jsmith}1:./a.out ä Type the name of the executable file at the prompt to run your program

17 17 Your First C Program # include # include main(void){ printf(“Hello, CSCI 230!\n”); } Try it!


Download ppt "1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience."

Similar presentations


Ads by Google