C Programming for the Absolute Beginner

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

If you are new to programming with C and are looking for a solid introduction, this is the book for you. Developed by computer science instructors, books in the for the absolute beginner(TM) series teach the principles of programming through simple game creation. C is not an easy language to learn, but fortunately the clear explanations, examples, and pictures in this book make learning C easy and fun. Each chapter contains programming challenges, a chapter review, and a complete program that uses chapter-based concepts to construct an easily built application. You will acquire the skills that you need for more practical C programming applications and will learn how these skills can be put to use in real-world scenarios. Additionally, by the time you finish this book, you will be able to apply the programming principles you've learned to the next programming language you tackle.

Author(s): Michael Vine
Edition: 2
Publisher: Cengage Learning
Year: 2007

Language: English
Pages: 317

TABLE OF CONTENTS
Chapter 1 GETTING STARTED WITH C PROGRAMMING
Installing and Configuring the Cygwin Environment
main() Function
Comments
Keywords
Program Statements
Escape Sequence \n
Escape Sequence \t
Escape Sequence \r
Escape Sequence \\
Escape Sequence \"
Escape Sequence \'
Directives
gcc Compiler
How to Debug C Programs
Common Error #1: Missing Program Block Identifiers
Common Error #2: Missing Statement Terminators
Common Error #3: Invalid Preprocessor Directives
Common Error #4: Invalid Escape Sequences
Common Error #5: Invalid Comment Blocks
Summary
Challenges
Chapter 2 PRIMARY DATA TYPES
Memory Concepts
Data Types
Integers
Floating-Point Numbers
Characters
Initializing Variables and the Assignment Operator
Printing Variable Contents
Conversion Specifiers
Displaying Integer Data Types with printf()
Displaying Floating-Point Data Types with printf()
Displaying Character Data Types with printf()
Constants
Programming Conventions and Styles
White Space
Variable Naming Conventions
Identifying Data Types with a Prefix
Using Uppercase and Lowercase Letters Appropriately
Give Variables Meaningful Names
scanf()
Arithmetic in C
Operator Precedence
Chapter Program–Profit Wiz
Summary
Challenges
Chapter 3 CONDITIONS
Algorithms for Conditions
Expressions and Conditional Operators
Pseudo Code
Flowcharts
Simple if Structures
Nested if Structures
Introduction to Boolean Algebra
and Operator
or Operator
not Operator
Order of Operations
Building Compound Conditions with Boolean Operators
Compound if Structures and Input Validation
&& Operator
|| Operator
Checking for Upper- and Lowercase
Checking for a Range of Values
isdigit() Function
The switch Structure
Random Numbers
Chapter Program–Fortune Cookie
Summary
Challenges
Chapter 4 LOOPING STRUCTURES
Pseudo Code for Looping Structures
Flowcharts for Looping Structures
Operators Continued
++ Operator
– Operator
+= Operator
-= Operator
The while Loop
The do while Loop
The for Loop
break and continue Statements
System Calls
Chapter Program–Concentration
Summary
Challenges
Chapter 5 STRUCTURED PROGRAMMING
Introduction to Structured Programming
Top-Down Design
Code Reusability
Information Hiding
Function Prototypes
Function Definitions
Function Calls
Variable Scope
Local Scope
Global Scope
Chapter Program–Trivia
Summary
Challenges
Chapter 6 ARRAYS
Introduction to Arrays
One-Dimensional Arrays
Creating One-Dimensional Arrays
Initializing One-Dimensional Arrays
Searching One-Dimensional Arrays
Two-Dimensional Arrays
Initializing Two-Dimensional Arrays
Searching Two-Dimensional Arrays
Chapter Program–Tic-Tac-Toe
Summary
Challenges
Chapter 7 POINTERS
Pointer Fundamentals
Declaring and Initializing Pointer Variables
Printing Pointer Variable Contents
Functions and Pointers
Passing Arrays to Functions
The const Qualifier
Chapter Program–Cryptogram
Introduction to Encryption
Building the Cryptogram Program
Summary
Challenges
Chapter 8 STRINGS
Introduction to Strings
Reading and Printing Strings
String Arrays
Converting Strings to Numbers
Manipulating Strings
strlen()
tolower() and toupper()
strcpy()
strcat()
Analyzing Strings
strcmp()
strstr()
Chapter Program–Word Find
Summary
Challenges
Chapter 9 INTRODUCTION TO DATA STRUCTURES
Structures
struct
typedef
Arrays of Structures
Passing Structures to Functions
Passing Structures by Value
Passing Structures by Reference
Passing Arrays of Structures
Unions
Type Casting
Chapter Program–Card Shuffle
Summary
Challenges
Chapter 10 DYNAMIC MEMORY ALLOCATION
Memory Concepts Continued
Stack and Heap
sizeof
malloc()
Managing Strings with malloc()
Freeing Memory
Working with Memory Segments
calloc() and realloc()
Chapter Program–Math Quiz
Summary
Challenges
Chapter 11 FILE INPUT AND OUTPUT
Introduction to Data Files
Bits and Bytes
Fields, Records, and Files
File Streams
Opening and Closing Files
Reading Data
Writing Data
Appending Data
goto and Error Handling
Chapter Program–The Phone Book Program
Summary
Challenges
Chapter 12 THE C PREPROCESSOR
Introduction to the C Preprocessor
Symbolic Constants
Creating and Using Macros
Building Larger Programs
Header File
Function Definition File
main() Function File
Pulling It all Together
Chapter Program–The Function Wizard
ch12_calculate.h
ch12_calculate.c
ch12_main.c
Summary
Challenges
What's Next?
Appendix A: COMMON UNIX COMMANDS
Appendix B: VIM QUICK GUIDE
Appendix C: NANO QUICK GUIDE
Appendix D: COMMON ASCII CHARACTER CODES
Appendix E: COMMON C LIBRARY FUNCTIONS
INDEX
A
B
C
D
E
F
G
H
I
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Z