rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9780764570681

C For Dummies

by
  • ISBN13:

    9780764570681

  • ISBN10:

    0764570684

  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2004-05-07
  • Publisher: For Dummies
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $24.99 Save up to $0.02
  • Buy New
    $24.97

    THIS IS A HARD-TO-FIND TITLE. WE ARE MAKING EVERY EFFORT TO OBTAIN THIS ITEM, BUT DO NOT GUARANTEE STOCK.

Summary

while (dead_horse) beat (): If you're like most people, the above seems like nonsense. Actually, it's computer sense-C programming. After digesting C For Dummies, 2 nd Edition, you'll understand it. C programs are fast, concise and versatile. They let you boss your computer around for a change. So turn on your computer, get a free compiler and editor (the book tells you where), pull up a chair, and get going. You won't have to go far (page 13) to find your first program example. You'll do short, totally manageable, hands-on exercises to help you make sense of: All 32 keywords in the C language (that's right-just 32 words) The functions-several dozen of them Terms like printf(), scanf(), gets (), and puts () String variables, numeric variables, and constants Looping and implementation Floating-point values In case those terms are almost as intimidating as the idea of programming, be reassured that C For Dummies was written by Dan Gookin, bestselling author of DOS For Dummies, the book that started the whole library. So instead of using expletives and getting headaches, you'll be using newly acquired skills and getting occasional chuckles as you discover how to: Design and develop programs Add comments (like post-it-notes to yourself) as you go Link code to create executable programs Debug and deploy your programs Use lint, a common tool to examine and optimize your code A helpful, tear-out cheat sheet is a quick reference for comparison symbols, conversion characters, mathematical doodads, C numeric data types, and more. C For Dummies takes the mystery out of programming and gets you into it quickly and painlessly.

Author Biography

Dan Gookin (Coeur d'Alene, Idaho) wrote the first-ever For Dummies book, DOS For Dummies, as well as the bestselling PCs For Dummies and Word For Dummies. He wrote C For Dummies Volumes One and Two. Dan's books have been translated into 32 languages and have more than 11 million copies in print.

Table of Contents

Introduction 1(6)
"What Will Understanding C Do for Me?"
1(1)
About This Here Dummies Approach
2(1)
How to Work the Examples in This Book
2(1)
Foolish Assumptions
3(1)
Icons Used In This Book
3(1)
What's New with This Edition?
4(1)
Final Thoughts
4(3)
Part I: Introduction to C Programming 7(66)
Chapter 1: Up from the Primordial C
9(10)
An Extremely Short and Cheap History of the C Language
9(2)
The C Development Cycle
11(1)
From Text File to Program
11(5)
The source code (text file)
12(1)
Creating the GOODBYE.C source code file
13(1)
The compiler and the linker
14(1)
Compiling GOODBYE.C
15(1)
Running the final result
16(1)
Save It! Compile and Link It! Run It!
16(3)
Chapter 2: C of Sorrow, C of Woe
19(10)
The Required Woes of Editing and Recompiling
19(3)
Reediting your source code file
20(1)
Recompiling (or the C equivalent of the "do-over")
21(1)
Dealing with the Heartbreak of Errors
22(7)
Yikes! An error! But, before you shoot yourself
22(1)
The autopsy
23(1)
Repairing the malodorous program
24(2)
Now try this errors
26(3)
Chapter 3: C Straight
29(10)
The Big Picture
29(1)
C Language Pieces' Parts
30(2)
The C Language Itself - the Keywords
32(2)
Other C Language Components
34(1)
Pop Quiz!
35(1)
The Helpful RULES Program
36(3)
The importance of being /n
36(1)
Breaking up lines\ is easy to do
37(2)
Chapter 4: C What I/0
39(16)
Introduce Yourself to Mr. Computer
39(2)
Compiling WHORU.C
40(1)
The reward
41(1)
More on printf( )
41(8)
Printing funky text
42(2)
Escape from printf( )!
44(2)
The f means "formatted"
46(1)
A bit of justification
47(2)
scanf Is Pronounced "Scan-Eff"
49(6)
Putting scanf together
49(2)
The miracle of scanf( )
51(1)
Experimentation time!
52(3)
Chapter 5: To C or Not to C
55(10)
Adding Comments
55(3)
A big, hairy program with comments
56(2)
Why are comments necessary?
58(1)
Comment Styles of the Nerdy and Not-Quite-Yet-Nerdy
58(3)
Bizarr-o comments
59(1)
C++ comments
60(1)
Using Comments to Disable
61(1)
The Perils of "Nested" Comments
62(3)
Chapter 6: C More I/0 with gets O and puts( )
65(8)
The More I Want, the More I gets( )
65(2)
Another completely rude program example
66(1)
And now, the bad news about gets( )
67(1)
The Virtues of puts( )
67(8)
Another silly command-prompt program
68(1)
puts( ) and gets( ) In action
68(1)
More insults
69(1)
puts( ) can print variables
70(3)
Part II: Run and Scream from Variables and Math 73(58)
Chapter 7: A + B = C
75(18)
The Ever-Changing Variable
75(2)
Strings change
76(1)
Running the KITTY
77(1)
Welcome to the Cold World of Numeric Variables
77(9)
Hello, integer
78(1)
Using an integer variable in the Methuselah program
79(1)
Assigning values to numeric variables
80(1)
Entering numeric values from the keyboard
81(1)
The atoi( ) function
81(2)
So how old is this Methuselah guy, anyway?
83(2)
You and Mr. Wrinkles
85(1)
A Wee Bit o' Math
86(7)
Basic mathematical symbols
86(2)
How much longer do you have to live to break the
Methuselah record?
88(2)
Bonus modification on the final Methuselah program!
90(1)
The direct result
91(2)
Chapter 8: Charting Unknown Cs with Variables
93(14)
Cussing, Discussing, and Declaring Variables
93(8)
"Why must I declare a variable?"
94(1)
Variable names verboten and not
95(1)
Presetting variable values
96(2)
The old random-sampler variable program
98(1)
Maybe you want to chance two pints?
99(1)
Multiple declarations
100(1)
Constants and Variables
101(6)
Dreaming up and defining constants
101(1)
The handy shortcut
102(2)
The #define directive
104(2)
Real, live constant variables
106(1)
Chapter 9: How to C Numbers
107(14)
There Are Numbers, and Then There Are Numbers
107(6)
Numbers In C
108(2)
Why use integers? Why not just make every number floating-point?
110(1)
Integer types (short, long, wide, fat, and so on)
110(1)
Signed or unsigned, or "Would you like a minus sign with that, Sir?"
111(2)
How to Make a Number Float
113(5)
"Hey, Carl, let's write a floating-point number program!"
114(2)
The E notation stuff
116(2)
Bigger than the Float, It's a Double!
118(1)
Formatting Your Zeroes and Decimal Places
119(2)
Chapter 10: Cook That C Variable Charred, Please
121(10)
The Other Kind of Variable Type, the char
121(4)
Single-character variables
122(1)
Char in action
123(1)
Stuffing characters into character variables
124(1)
Reading and Writing Single Characters
125(3)
The getchar( ) function
126(1)
The putchar( ) function
127(1)
Character Variables As Values
128(3)
Part III: Giving Your Programs the Ability to Run Amok 131(120)
Chapter 11: C More Math and the Sacred Order of Precedence
133(14)
An All-Too-Brief Review of the Basic C Mathematical Operators
133(4)
The old "how tall are you" program
135(1)
Unethical alterations to the old "how tall are you" program
136(1)
The Delicate Art of Incrementation (Or, "Just Add One to It")
137(4)
Unhappily incrementing your weight
138(2)
Bonus program! (One that may even have a purpose in life)
140(1)
The Sacred Order of Precedence
141(6)
A problem from the pages of the dentistry final exam
141(1)
What's up, Sally?
142(2)
The confounding magic-pellets problem
144(1)
Using parentheses to mess up the order of precedence
145(2)
Chapter 12: C the Mighty if Command
147(18)
If Only
147(10)
The computer-genie program example
148(2)
The if keyword, up close and impersonal
150(4)
A question of formatting the if statement
154(1)
The final solution to the income-tax problem
155(2)
If It Isn't True, What Else?
157(8)
Covering all the possibilities with else
158(1)
The if format with else
159(1)
The strange case of else - if and even more decisions
160(3)
Bonus program! The really, really smart genie
163(2)
Chapter 13: What If C==C?
165(10)
The World of if without Values
165(9)
Which is greater: S or T, $ or -?
166(2)
The problem with getchar( )
168(2)
Fixing GREATER.C to easily read standard input
170(1)
"Can I get getchar( ) to read only one character?"
171(1)
Meanwhile, back to the GREATER problem
171(2)
Another, bolder example
173(1)
Using the if Keyword to Compare Two Strings
174(1)
Chapter 14: Iffy C Logic
175(10)
Exposing Flaws In logic
175(2)
If, And, Or, But
177(8)
A solution (but not the best one)
177(1)
A better solution, using logic
178(2)
The if command's logical friends
180(3)
A logical AND program for you
183(2)
Chapter 15: C You Again
185(16)
For Going Loopy
185(8)
Repetitive redundancy, I don't mind
187(1)
For doing things over and over, use the for keyword
188(2)
Tearing through OUCH.C a step at a time
190(2)
Having fun whilst counting to 100
192(1)
I'm Bustin' Outta Here!
193(8)
At last - the handy ASCII program
193(2)
Beware of infinite loops!
195(2)
Breaking out of a loop
197(1)
The break keyword
198(3)
Chapter 16: C the Loop, C the Loop++
201(14)
The Art of Incrementation
201(3)
Cryptic C operator symbols, Volume I: The inc operator (++)
202(1)
Another look at the LARDO.C program
203(1)
The Mysterious Practice of Decrementation
204(5)
O, to count backward
205(1)
How counting backward fits into the for loop
206(1)
Cryptic C operator symbols, Volume II: The dec operator (- -)
207(1)
A final improvement to OLLYOLLY.C
208(1)
More Incrementation Madness
209(6)
Leaping loops!
210(1)
Counting to 1,000 by fives
211(1)
Cryptic C operator symbols, Volume III: The madness continues
211(2)
The answers
213(2)
Chapter 17: C You in a While Loop
215(10)
The Lowdown on while Loops
215(8)
Whiling away the hours
216(2)
The while keyword (a formal introduction)
218(1)
Deciding between a while loop and a for loop
219(1)
Replacing those unsightly for (;;) loops with elegant while loops
220(2)
C from the inside out
222(1)
Not to Beat a Dead Horse or Anything
223(2)
Chapter 18: Do C While You Sleep
225(14)
The Down-Low on Upside-Down do while Loops
225(6)
The devil made me do while it!
226(1)
do-while details
227(1)
A flaw in the COUNTDWN.C program
228(1)
The always kosher number-checking do while loop
229(2)
Nested Loops and Other Bird-Brained Concepts
231(4)
Adding a tense, dramatic delay to the COUNTDWN.C program
231(3)
The nitty GRID.C of nested loops
234(1)
Break the Brave and Continue the Fool
235(4)
Please continue
236(1)
The continue keyword
237(2)
Chapter 19: Switch Case, or, From 'C' to Shining 'c'
239(12)
The Sneaky switch -case Loops
239(2)
The switch -case Solution to the LOBBY Program
241(2)
The Old switch-case Trick
243(5)
The Special Relationship between while and switch - case
248(3)
Part IV: C Level 251(86)
Chapter 20: Writing That First Function
253(12)
Meet Mr. Function
253(5)
A silly example you don't have to type
254(1)
A potentially redundant program in need of a function
255(1)
The noble jerk( ) function
256(1)
How the jerk( ) function works in BIGJERK2.C
257(1)
Prototyping Your Functions
258(4)
Prototypical prototyping problems
259(1)
A sneaky way to avoid prototyping problems
260(2)
The Tao of Functions
262(3)
The function format
262(1)
How to name your functions
263(2)
Chapter 21: Contending with Variables in Functions
265(10)
Bombs Away with the BOMBER Program!
265(4)
Will the dual variable BOMBER.C program bomb?
267(1)
Adding some important tension
267(2)
How We Can All Share and Love with Global Variables
269(6)
Making a global variable
270(1)
An example of a global variable in a real, live program
271(4)
Chapter 22: Functions That Actually Funct
275(18)
Marching a Value Off to a Function
275(5)
How to send a value to a function
276(1)
An example (and It's about time!)
277(2)
Avoiding variable confusion (must reading)
279(1)
Sending More than One Value to a Function
280(2)
Functions That Return Stuff
282(7)
Something for your troubles
282(2)
Finally, the computer tells you how smart it thinks you are
284(1)
Return to sender with the return keyword
285(2)
Now you can understand the main( ) function
287(1)
Give that human a bonus!
288(1)
No Need to Bother with This C Language Trivia If You're in a Hurry
289(4)
Chapter 23: The Stuff That Comes First
293(12)
Please Don't Leave Me Out!
294(8)
Say! Aren't you the #include construction?
294(3)
What's up with STDIO.H?
297(1)
Writing your own dot-H file
298(2)
A final warning about header files
300(2)
What the #defines Are Up To
302(1)
Avoiding the Topic of Macros
303(2)
Chapter 24: The printf( ) Chapter
305(8)
A Quick Review of printf( )
305(1)
The Old Displaying-Text-with-printf( ) Routine
306(1)
The printf( ) Escape Sequences
306(4)
The printf( ) escape-sequence testing program deluxe
307(1)
Putting PRINTFUN to the test
308(2)
The Complex printf( ) Format
310(1)
The printf( ) Conversion Characters
311(2)
Chapter 25: Math Madness!
313(12)
More on Math
313(6)
Taking your math problems to a higher power
314(1)
Putting pow( ) into use
315(2)
Rooting out the root
317(2)
Strange Math? You Got It!
319(1)
Something Really Odd to End Your Day
320(5)
The perils of using a++
320(2)
Oh, and the same thing applies to a - -
322(1)
Reflections on the strange ++a phenomenon
322(3)
Chapter 26: The Old Random-Number Function
325(12)
On Being Random
325(8)
Using the rand( ) function
326(2)
Planting a random-number seed
328(1)
Randoming up the RANDOM program
329(2)
Streamlining the randomizer
331(2)
The Diabolical Dr. Modulus
333(2)
Rolling the Dice with the Final RANDOM Program
335(2)
Part V: Part of Tens 337(22)
Chapter 27: Ten More Things You Need to Know about the C Language
339(8)
Arrays
339(1)
Strings
340(1)
Structures
341(2)
Pointers
343(1)
Linked Lists
343(1)
Binary Operators
344(1)
Interacting with the Command Line
345(1)
Disk Access
345(1)
Interacting with the Operating System
345(1)
Building Big Programs
346(1)
Chapter 28: Ten Tips for the Budding Programmer
347(6)
Use the Command-Line History
347(1)
Keep Your Editor Open in Another Window
348(1)
Use a Context-Colored Text Editor
348(1)
Know the Line-Number Commands in Your Editor
349(1)
Keep a Command Prompt Window Open If You're Using the IDF
350(1)
Know a Few Handy Command-Prompt Commands
350(1)
Carefully Name Your Variables
351(1)
Know Your Post- and Pre-Incrementing and Decrementing Riddles
351(1)
Breaking Out of a Loop
352(1)
Chapter 29: Ten Ways to Solve Your Own Programming Problems
353(6)
Work on One Thing at a Time
354(1)
Break Up Your Code
354(1)
Simplify
355(1)
Talk through the Program
355(1)
Set Breakpoints
356(1)
Monitor Your Variables
356(1)
Document Your Work
356(1)
Use Debugging Tools
357(1)
Use a C Optimizer
357(1)
Read More Books!
358(1)
Appendix A: The Stuff You Need to Know before You Read All the Other Stuff in This Book 359(12)
Setting Things Up
359(4)
The C language compiler
360(1)
The place to put your stuff
361(2)
Making Programs
363(8)
Finding your learn directory or folder
363(1)
Running an editor
364(1)
Compiling and linking
365(6)
Appendix 5: ASCII Table 371(6)
Index 377

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program