Chapter 1 - PowerPoint PPT Presentation

libitha
chapter 1 n.
Skip this Video
Loading SlideShow in 5 Seconds..
Chapter 1 PowerPoint Presentation
play fullscreen
1 / 11
Download Presentation
Chapter 1
559 Views
Download Presentation

Chapter 1

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Chapter 1 Introduction to Programming in C

  2. CSC 140 PROFESSOR: David L. Sonnier Derby 208 698-4270 TEXTBOOK: K. N. King, C Programming: A Modern Approach (Available at the Lyon Bookstore)

  3. Your Evaluation • Quizzes/Homework/Effort 10% • Projects 30% • Tests 40% • Final Exam (2 hours) 20%

  4. Introduction to C • Objective: Learn to program, using Cas a vehicle • Programming languages: Language for communicating with a computer • Machine Code (Machine Language) • Assembly Language • High Level Language • The LINUX environment / Operating System • Writing your first C program – vi editor • Finding & fixing errors

  5. Terminology • Compiler • Source code • Object code • Program • Operating System • Editor

  6. History of LINUX • UNIX Operating System – Developed at Bell Labs • LINUX – an “imitation” of UNIX developed by programmer Linus Torvalds and an international group of fanatics and enthusiasts in the 1990’s • “Open Source” operating system • Various versions: SUSE, Red Hat, etc. • Ideal operating system / programming environment

  7. History of C • BCPL (Basic Computer Programming Language) • B – Developed from BCPL (~1970) • NB – “New B,” better suited for the PDP-11 • C – Developed in the 1970’s. • C++ - Allows the object-oriented approach

  8. Characteristics of C • A “low-level” language; provides machine-level functionality with elements of a high-level language • A “small” language – limited set of features. • A “permissive” language – Assumes you know what you’re doing….allows you to make some BAD mistakes.

  9. Strengths • Efficiency • Portability • Power • Flexibility • Standard Library • Integration with UNIX / LINUX

  10. Weaknesses • Can be error-prone – BAD mistakes don’t get caught by the compiler • C Programs can be difficult to understand • C Programs can be difficult to modify

  11. Program: pun.c /* Name: pun.c */ /* David L. Sonnier */ /* August 23 */ /* Pledged */ /* This program prints a REALLY BAD pun. */ #include <stdio.h> //main() is where program execution begins. main() { printf(“To C, or not to C: that is the question.\n”); }