Free tutorial : C programming language
Free tutorial : C programming language
Table of Contents
Introduction
Getting Started with C
The Components of a C Program
Storing Data: Variables and Constants
Statements, Expressions, and Operators
Functions: The Basics
Basic Program Control
Fundamentals of Input and Output
Using Numeric Arrays
Understanding Pointers
Characters and Strings
Structures
Understanding Variable Scope
Advanced Program Control
Working with the Screen, Printer, and Keyboard
Pointers: Beyond the Basics
Using Disk Files
Manipulating Strings
Getting More from Functions
Exploring the C Function Library
Working with Memory
Advanced Compiler Use
-----------------------------------
Sample of the pdf document
Introduction
As you can guess from the title, this book is set up so that you can teach yourself the C programming
language in 21 days. Despite stiff competition from newer languages such as C++ and Java, C remains
the language of choice for people who are just learning programming. For reasons we detail on Day 1,
you can't go wrong in selecting C as your pro-gramming language.
We think you've made a wise decision selecting this book as your means of learning C. Although there
are many books on C, we believe this book presents C in the most logical and easy-to-learn sequence.
The fact that previous editions have constantly been on the best-seller lists indicates that readers agree
with us!
We designed this book for you to work through the chapters in order on a daily basis. We don't
assume any previous programming experience on your part, although experience with another language,
such as BASIC, might help you learn faster. We also make no assumptions about your computer or
compiler; this book concentrates on teaching the C language, regardless of whether you're using a PC, a
Mac, or a UNIX system.
This Book's Special Features
This book contains some special features to aid you on your path to C enlightenment. Syntax boxes show
you how to use specific C concepts. Each box provides concrete examples and a full explanation of the C
command or concept. To get a feel for the style of the syntax boxes, look at the following example.
(Don't try to understand the material; you haven't even reached Day 1!)
#include <stdio.h>
printf( format-string[,arguments,...]);
printf() is a function that accepts a series of arguments, each applying to a conversion specifier in the
given format string. It prints the formatted information to the standard output device, usually the display
screen. When using printf(), you need to include the standard input/output header file, STDIO.H.
The format-string is required; however, arguments are optional. For each argument, there must be a
conversion specifier. The format string can also contain escape sequences. The following are examples of
calls to printf() and their output:
Example 1
#include <stdio.h>
main()
{
printf( "This is an example of something printed!");
}
Example 1 Output
This is an example of something printed!7
Example 2
printf( "This prints a character, %c\na number, %d\na floating point,
%f", `z', 123, 456.789 );
Example 2 Output
This prints a character, z
a number, 123
a floating point, 456.789
Another feature of this book is Do/Don't boxes, which give you pointers on what to do and what not to do.
DO read the rest of this section. It explains the Workshop sections that appear at the end of each day.
DON'T skip any of the quiz questions or exercises. If you can finish the day's workshop, you're ready to move on to new material.
You'll encounter Tip, Note, and Warning boxes as well. Tips provide useful shortcuts and techniques for
working with C. Notes provide special details that enhance the explanations of C concepts. Warnings
help you avoid potential problems.
Numerous sample programs illustrate C's features and concepts so that you can apply them in your own
programs. Each program's discussion is divided into three components: the program itself, the input
required and the output generated by it, and a line-by-line analysis of how the program works. These
components are indicated by special icons.
Each day ends with a Q&A section containing answers to common questions relating to that day's
material. There is also a Workshop at the end of each day. It contains quiz questions and exercises. The
quiz tests your knowledge of the concepts presented on that day. If you want to check your answers, or if
you're stumped, the answers are provided in Appendix G.
You won't learn C just by reading this book, however. If you want to be a programmer, you've got to
write programs. Following each set of quiz questions is a set of exercises. We recommend that you
attempt each exercise. Writing C code is the best way to learn C.
We consider the BUG BUSTER exercises most beneficial. A bug is a program error in C. BUG
BUSTER exercises are code listings that contain common problems (bugs). It's your job to locate and fix
these errors. If you have trouble busting the bugs, these answers also are given in Appendix G.
As you progress through this book, some of the exercise answers tend to get long. Other exercises have a
multitude of answers. As a result, later chapters don't always provide answers for all the exercises.
Click here for Download PDF / FREE
Free tutorial : C programming language
0 commentaires: