INTRODUCTION
The C programming language was developed by Dennis Ritchie at AT&T Bell Laboratories in the early 1970s. Soon after, Bell Laboratories developed a new operating system, called UNIX. About 90% of the code for the Unix operating system (OS) was exclusively in C. As C gained popularity, more and more vendors joined the race and developed their own compilers.
This was necessary because until the late 1970s, only Bell Laboratories had a C compiler. In the early 1980s, realizing the need to standardize the C language, the American Standards Institute (ANSI), an organization that handles such matters, began the task. In 1990, the first official ANSI standard definition of C was published. Soon C became omnipresent and thus there was a need of further standardization. The International Standards Organization (ISO) adopted a standard called ISO/IEC 9899:1990. After 1990, many additional changes were made in the C language. In 1993, an ANSI C committee (known as X3J11), was formed to standardize C. The most recent standard was adopted in 1999. It is known as ANSI C99 or ISO/IEC 9899:1999. Since then, ANSI C has been implemented on a wide variety of computers, including IBM-compatible personal computers (PCs), mainframes, minicomputers, and workstations.
C is a higher-level language that nevertheless allows the programmer to deal with hardware at a much lower level. Please note that although C is a general-purpose programming language, it was designed with systems programming applications in mind. So it provides a lot of power and flexibility. This chapter discusses some basic terminology related to C and also explains the process of compiling a program written in the C language.
CONTENTS
- Preface
- Acknowledgments
- Chapter 1: C Overview
- 1.0 Introduction
- 1.1 The Concept of Algorithms and Pseudocodes
- 1.2 Flowcharts
- 1.3 Compiler Overview
- 1.4 Assembler, Linker, and Loader
- 1.5 Structure of a Simple “Hello World” Program in C
- 1.6 Overview of the Compilation and Execution Process in an Integrated
- Development Environment (preferably CodeBlock)
- Summary
- Exercises
- Chapter 2: Programming Using C
- 2.0 Introduction
- 2.1 Preprocessor Directives/Compiler Directives/C Preprocessor
- 2.2 C Primitive Input-Output using getchar and putchar
- 2.3 Simple Input/Output
- 2.4 Function Calls from a Library
- 2.5 Data Types in C
- 2.6 Enumeration
- 2.7 Operators
- 2.8 Type Casting (or Coercion) in C
- 2.9 Conditional Executing Using If-Else
- 2.10 Switch and Break
- 2.11 The Concept of Loops—While Loop, Do-While Loop, For Loop, Nested Loops,
- Break Statement, Continue Statement
- 2.12 Storage Classes: Auto, Static, Extern, and Register
- Summary
- Exercises
- Chapter 3: Arrays And Pointers
- 3.0 Introduction
- 3.1 1D, 2D, and 3D Arrays
- 3.2 The Concept of Subprogramming
- 3.3 Functions
- 3.4 Parameter Transmission Techniques—Call by Value and Call by Reference
- 3.5 Pointers
- 3.6 Relationship between Array and Pointer
- 3.7 Argument Passing Using Pointers
- 3.8 Array of Pointers
- 3.9 Passing Arrays as Arguments
- Summary
- Exercises
- Chapter 4: Structures And Unions
- 4.0 Introduction
- 4.1 Structures versus Unions
- 4.2 Structures and Pointers
- Summary
- Exercises Questions
- Chapter 5: File Handling In C
- 5.0 Introduction
- 5.1 File Pointers
- 5.2 Character Input / Output with Files
- 5.3 String I/O Functions
- 5.4 Integer I/O Functions
- 5.5 Formatted I/O Functions
- 5.6 Block (or Record) I/O Functions
- Summary
- Exercises
- Appendices
- A: C Programming Lab Projects
- B: Keywords in C
- C: Escape Sequences in C
- D: Operator Precedence and Associativity
- E: Standard Library String Functions
- References
Happy learning!

!