Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduction to C Programming
1
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
Objectives
Learn the history of C and its evolvement.
Learn the basics of C programming.
Learn to use C programming tools.
Learning Outcomes
Students will have basic knowledge about the history of
C and its evolvement.
Able to identify basic syntax in a simple C program.
Able to use C programming tools to write, compile and
test a simple C program.
2
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
2.1 History of C
C was invented for the purpose of writing the
Unix system
The birth of C and Unix took place in the early
1970s.
Did you know Linux was originally written in
C++, was then rewritten in C to increase its
execution efficiency?
3
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
The Fathers of C
Two researchers at Bell Telephone Laboratories. Ken
Thompson invented B, a precursor to Dennis Ritchies
C.
The chronicles of C
Late 1960s - Martin Richards designed BCPL.
1970 - Based on BCPL, Ken Thompson designed B (A stripped
down version of BCPL).
1972 - Based on B, C was designed by Dennis Ritchie. He then
published the first book on C with Brian Kernighan. First edition of C
was known as K&R C, after the authors of this book.
1972 to 80s - C gained wide popularity. Many versions of C
surfaced.
1989 - American National Standards Institute (ANSI) established the
X3J11 commitee to standardize C. Standard is defined, known as
ANSI-C, Standard C or C89.
1990 ANSI-C was adopted as an international standard: ISO
9899:1990, a.k.a. C90 (C89 = C90).
1999 - C standard was revised to become ISO 9899:1999, a.k.a.
C99.
5
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
7
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
9
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
To run Knoppix,
1. Adjust the boot list in the BIOS Setup of your
computer to boot from CD/DVD.
2. Insert Knoppix CD/DVD into the computer,
and reboot.
3. At the boot: prompt, type knoppix lang=en
to start Knoppix in English.
4. You will be brought to a standard desktop.
10
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
13
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
If there is error(s) in
C code, there will be
error message(s)
when you compile
your C code. Correct
the error(s) as
indicated in the
message(s) before
compiling the C
code again.
Column number
Platform
Windows/Linux/ Unix
Website
http://www.eng.auburn.edu/department/cse/
research/grasp/
Bloodshed Dev-C++
Windows
http://www.bloodshed.net/devcpp.html
Turbo C++
Windows
http://www.turboexplorer.com/cpp
Windows
http://www.microsoft.com/express/vc/
Code::Blocks
Anjuta DevStudio
Windows/Linux/ Mac
GNU/Linux
http://www.codeblocks.org/
http://www.anjuta.org/
18
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
*/
19
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
2.5 Summary
1.
2.
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
Summary
3.
4.
21
Powerpoint slides to be used with C Programming for Beginners by HC Ling, SN Cheong, YK Teh,
LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)