Sie sind auf Seite 1von 20

Chapter 1: A Brief History of C

C The Complete Reference - Herbert


Schildt (4th Edition)
Prepared by: Dr. M Khairul Islam
Professor, Dept. of CSE, CU
Biography
EDUCATION
1992 SSC Comilla
1994 HSC Comilla Victoria Govt. College
Shahjalal University of Science & Technology
1995-2000 BSc Engg
(SUST), Sylhet
Information Engineering, Korea Aerospace University,
2005-2007 Master
South Korea
Information Engineering, Korea Aerospace University,
2007-2011 PhD
South Korea

PROFESSION
2001 Lecturer Dept. of Computer Science, CU
2003 Assistant Professor Dept. of Computer Science, CU
2011 Associate Professor Dept. of Computer Science, CU
2016 - till Professor Dept. of Computer Science & Engineering, CU
2017 Visiting Professor Griffith University, QLD, Australia
Lecture Plan
Lecture # Date Topic
Lecture 1 7-Sep-19 Overview
Lecture 2 14-Sep-19 C Fundamentals
Lecture 3 21-Sep-19 C Fundamentals & Quiz 1
Lecture 4 28-Sep-19 Program Control Statements
Lecture 5 5-Oct-19 Program Control Statements & HW1
Lecture 6 12-Oct-19 Program Control Statements & Quiz 2
Lecture 7 19-Oct-19 Data Types
Lecture 8 26-Oct-19 Array & Class Test 1
Lecture 9 2-Nov-19 Array
Lecture 10 9-Nov-19 Pointer & HW2
Lecture 11 16-Nov-19 Pointer
Lecture 12 23-Nov-19 Structure
Lecture 13 30-Nov-19 File & Class Test 2
Lecture 14 7-Dec-19 Recap & HW3
References
A Brief History of C
• C was invented and first implemented by
Dennis Ritchie on a DEC PDP-11 that used the
Unix operating system.
• In the summer of 1983 a committee was
established to create an ANSI (American
National Standards Institute) standard that
would define the C language.
• The version of C defined by the 1989 standard
is commonly referred to as C89.
A Brief History of C
• The C99 standardization committee focused
on two main areas: the addition of several
numeric libraries and the development of
some special-use, but highly innovative, new
features, such as variable-length arrays and
the restrict pointer qualifier.
C Is a Middle-Level Language
• because it combines the best elements of high-
level languages with the control and flexibility of
assembly language.
• As a middle-level language, C allows the
manipulation of bits, bytes, and addresses— the
basic elements with which the computer
functions.
• C code is also very portable: it is easy to adapt
software written for one type of computer or
operating system (DOS -> Windows 2000) to
another type.
C Is a Structured Language
• A structured language offers a variety of
programming possibilities. For example,
structured languages typically support several
loop constructs, such as while, do-while, and
for.
• In a structured language, the use of goto is
either prohibited or discouraged
C Is a Structured Language
C Is a Structured Language
• Another way to structure and compartmentalize
code in C is through the use of blocks of code. A
code block is a logically connected group of
program statements that is treated as a unit.
Example:
Compilers vs. Interpreters
• There are two general methods by which a
program can be executed. It can be compiled,
or it can be interpreted.
• For example, BASIC and Java were designed to
be interpreted, and C was designed to be
compiled.
Compilers vs. Interpreters
• A compiler reads the entire program and converts
it into object code, which is a translation of the
program's source code into a form that the
computer can execute directly.
• Object code is also referred to as binary code or
machine code. Once the program is compiled, a
line of source code is no longer meaningful in the
execution of your program.
• An interpreter reads the source code of your
program one line at a time, performing the
specific instructions contained in that line.
C89 Keywords
C99 Keywords

• In C, uppercase and lowercase characters are


different: else is a keyword; ELSE is not. You may
not use a keyword for any purpose other than as
a keyword in a C program— that is, you may not
use it as a variable or function name.
C Function
• All C programs consist of one or more
functions. As a general rule, the only function
that must be present is called main( ), which is
the first function called when program
execution begins.
The Library and Linking
• C does not provide keywords that perform such
things as input/output (I/O) operations, high-level
mathematical computations, or character
handling. As a result, most programs include calls
to various functions contained in C's standard
library.
• When you call a library function, the C compiler
''remembers" its name. Later, the linker combines
the code you wrote with the object code already
found in the standard library. This process is
called linking.
Compiling a C Program
• Creating an executable form of your C
program consists of these three steps:
1. Creating your program
2. Compiling your program
3. Linking your program with whatever functions are
needed from the library
C's Memory Map

Free Space

return
addresses of
function
calls,
arguments
to functions,
and local
variables Executable
Code
Review of Terms

Das könnte Ihnen auch gefallen