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"

Many students of C will rightly admit that it's not an easy language to learn, but the professional insight, clear explanations, examples, and pictures in the Cengage Learning for the Absolute Beginner series make learning C easy and fun. Programming is not a skill you can acquire by reading; you have to write programs to learn. That's why each chapter in this book contains programming challenges, a chapter review, and a complete program that uses chapter-based concepts to construct an easily built application. With the guidance in this book, you'll learn how to create algorithms and pseudocode to think through and design programs; translate your designs and plans into working C programs; write, compile, test, and debug your code; use data types, arrays, pointers, strings, file operations and more to create robust programs.

Author(s): Michael Vine
Edition: 3
Publisher: Cengage Learning
Year: 2014

Language: English
Pages: 315

Cover
Table of Contents
Introduction
1 Getting Started with C Programming
Installing and Configuring the Cygwin Environment
Understanding the main() Function
Using Comments
Understanding Keywords
Working with Program Statements
Escape Sequence \n
Escape Sequence \t
Escape Sequence \r
Escape Sequence \\
Escape Sequence \"
Escape Sequence \'
Using Directives
Creating and Running Your First C Program
Debugging 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
2 Primary Data Types
Exploring Memory Concepts
Understanding Data Types
Using Integers
Using Characters
Initializing Variables and the Assignment Operator
Printing Variable Contents
Using Conversion Specifiers
Displaying Integer Data Types with printf()
Displaying Floating-Point Data Types with printf().
Displaying Character Data Types with printf()
Understanding Constants
Using Programming Conventions and Styles
Using White Space
Understanding Variable Naming Conventions
Identifying Data Types with a Prefix
Using Uppercase and Lowercase Letters Appropriately
Giving Variables Meaningful Names
Using the scanf() Function
Doing Arithmetic in C
Understanding Operator Precedence
Chapter Program: Shop Profit
Summary
3 Conditions
Algorithms for Conditions
Expressions and Conditional Operators
Pseudocode
Flowcharts
Simple if Structures
Nested if Structures
Introduction to Boolean Algebra
The and Operator
The or Operator
The not Operator
Order of Operations
Building Compound Conditions with Boolean Operators
Compound if Structures and Input Validation
The && Operator
The || Operator
Checking for Upper- and Lowercase
Checking for a Range of Values
The isdigit() Function
The switch Structure
Random Numbers
Chapter Program: Fortune Cookie
Summary
4 Looping Structures
Pseudocode for Loops
Flowcharts for Loops
Additional Operators.
The ++ Operator
The – – Operator
The += Operator
The –= Operator
The while Loop
The do while Loop
The for Loop
break and continue Statements
SystemCalls
Chapter Program: Concentration
Summary
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
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
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
8 Strings
Introduction to Strings
Reading and Printing Strings
String Arrays
Converting Strings to Numbers
Manipulating Strings
The strlen() Function
The tolower() and toupper() Functions
The strcpy() Function
The strcat() Function
Analyzing Strings
The strcmp() Function
The strstr() Function
Chapter Program: Word Find
Summary
9 Introduction to Data Structures
Structures
The struct Keyword
The typedef Keyword
Arrays of Structures
Structures and Functions
Passing Structures by Value
Passing Structures by Reference
Passing Arrays of Structures
Unions
Typecasting
Chapter Program: Card Shuffle
Summary
10 Dynamic Memory Allocation
Dynamic Memory Concepts
Stack and Heap
The sizeof Operator
The malloc() Function
Managing Strings with malloc()
Freeing Memory
Working with Memory Segments
The calloc() and realloc() Functions
Chapter Program: Math Quiz
Summary
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: Character Roster
Summary
12 The C Preprocessor
Understanding the C Preprocessor
Symbolic Constants
Creating and Using Macros
Building Larger Programs
Header Files
Function Definition File
main() Function File
Chapter Program: The Function Wizard
ch12_calculate.h
ch12_calculate.c
ch12_main.c
Summary
What’s Next?
A: Common UNIX Commands
B: Vim Quick Guide
C: nano Quick Guide
D: TCC Quick Guide
Installing and Configuring TCC for Windows
Downloading TCC
Installing TCC
Configuring TCC
Creating, Compiling, and Executing Code
Creating and Editing Source Code
Compiling and Executing Source Code
E: ASCII Character Codes
F: Common C Library Functions
Index
A
B
C
D
E
F
G
H
I-J
K
L
M
N
O
P
Q-R
S
T
U
V
W-Z