110 likes | 801 Views
Chapter 1. Introduction to Programming in C. CSC 140. PROFESSOR: David L. Sonnier Derby 208 698-4270 TEXTBOOK: K. N. King, C Programming: A Modern Approach ( Available at the Lyon Bookstore ). Your Evaluation. Quizzes/Homework/Effort 10% Projects 3 0% Tests 40%
E N D
Chapter 1 Introduction to Programming in C
CSC 140 PROFESSOR: David L. Sonnier Derby 208 698-4270 TEXTBOOK: K. N. King, C Programming: A Modern Approach (Available at the Lyon Bookstore)
Your Evaluation • Quizzes/Homework/Effort 10% • Projects 30% • Tests 40% • Final Exam (2 hours) 20%
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
Terminology • Compiler • Source code • Object code • Program • Operating System • Editor
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
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
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.
Strengths • Efficiency • Portability • Power • Flexibility • Standard Library • Integration with UNIX / LINUX
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
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”); }