Docsity

Introduction to C Programming: Understanding the Basics of C and Systems Programming - Pro, Study notes of Computer Science

Partial preview of the text

Download Introduction to C Programming: Understanding the Basics of C and Systems Programming - Pro and more Study notes Computer Science in PDF only on Docsity!

Description

of the C Programming Language

and Programming Process

CPS 196

Introduction to Programming: C

Lecture 1

Dr. Nancy McCracken

August 27, 2007

What is C? •^

Developed at Bell Labs around 1969^ –

Emerged as the “winner” from a sequence of languages, including alanguage called “B”

-^

Originally created for systems programming, i.e. writingsoftware that controls hardware and other software.^ –

UNIX and other operating systems are written in C (+ machinecode)– So are many compilers, GUIs, device drivers, etc.

C has low-level language features •^

A distinguishing feature between C and other modern,popular programming languages is that it has an unusuallyrich set of operators that can be used to make the

programs

run very efficiently^ –

Includes operators that mimic machine language instructions, e.g. bitmanipulation instructions– Explicit memory management– Direct manipulation of addresses, or pointers

Why learn C? •^

C is a good beginners language because the basicprogramming concepts can be learned with a minimum ofcomplex features

-^

Knowing C is a good step towards learning other languages

-^

You may have to read C programs, even if you don’t writethem

-^

It is still the high-level language of choice for systemsprogrammers^ –

supports writing fast, tight code with minimal space

-^

Many commercial tools and code libraries can be used mosteasily from C^ –

Much public domain code is available through open source andother projects

Programming Process •^

Write instructions in a high-level programming language,stored in the source file

-^

The compiler translates to computer instructions andcombines it with other library functions^ –

Libraries provide commonly useful functions such as I/O(input/output), mathematics, graphics, …

Computerinstructions

InputData

OutputResults

Source file

Library functions

programmer

compiler