C for Dummies 2nd edition phần 1 pptx

42 290 0
C for Dummies 2nd edition phần 1 pptx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... in action .12 3 Stuffing characters into character variables 12 4 xi xii C For Dummies, 2nd Edition Reading and Writing Single Characters .12 5 The getchar() function 12 6 The putchar() function 12 7 Character Variables As Values 12 8 Part III: Giving Your Programs the Ability to Run Amok .13 1 Chapter 11 : C More Math and the Sacred Order of Precedence 13 3... .11 1 How to Make a Number Float .11 3 “Hey, Carl, let’s write a floating-point number program!” .11 4 The E notation stuff 11 6 Bigger than the Float, It’s a Double! 11 8 Formatting Your Zeroes and Decimal Places 11 9 Chapter 10 : Cook That C Variable Charred, Please 12 1 The Other Kind of Variable Type, the char 12 1 Single-character variables .12 2 Char... I: Introduction to C Programming 7 Chapter 1: Up from the Primordial C 9 An Extremely Short and Cheap History of the C Language 9 The C Development Cycle 11 From Text File to Program 11 The source code (text file) 12 Creating the GOODBYE .C source code file 13 The compiler and the linker 14 Compiling GOODBYE .C 15 Running... is tackled by the compiler The compiler is a special program that reads the instructions stored in the source code file, examines each instruction, and then translates the information into the machine code understood only by the computer’s microprocessor Chapter 1: Up from the Primordial C If all goes well and the compiler is duly pleased with your source code, the compiler creates an object code... 16 6 The problem with getchar() 16 8 Fixing GREATER .C to easily read standard input 17 0 “Can I get getchar() to read only one character?” 17 1 Meanwhile, back to the GREATER problem 17 1 Another, bolder example 17 3 Using the if Keyword to Compare Two Strings 17 4 Table of Contents Chapter 14 : Iffy C Logic 17 5 Exposing Flaws in logic ... fives 211 Cryptic C operator symbols, Volume III: The madness continues 211 The answers 213 Chapter 17 : C You in a While Loop 215 The Lowdown on while Loops 215 Whiling away the hours . 216 The while keyword (a formal introduction) 218 Deciding between a while loop and a for loop 219 Replacing those unsightly for( ;;) loops... 18 8 Tearing through OUCH .C a step at a time .19 0 Having fun whilst counting to 10 0 19 2 I’m Bustin’ Outta Here! 19 3 At last — the handy ASCII program 19 3 Beware of infinite loops! 19 5 Breaking out of a loop 19 7 The break keyword 19 8 Chapter 16 : C the Loop, C the Loop++ 2 01 The Art of Incrementation 2 01 Cryptic C. .. to bump into Mr Ritchie In that case, you can say “Hey, aren’t you Dennis Ritchie, the guy who invented C? ” And he’ll say “Why — why, yes I am.” And you can say “Cool.” The C Development Cycle Here is how you create a C program in seven steps — in what’s known as the development cycle: 1 Come up with an idea for a program 2 Use an editor to write the source code 3 Compile the source code and link the... attempt to compile the program again — you recompile and relink ߜ The compiler translates the information in the source code file into instruc­ tions the computer can understand The linker then converts that infor­ mation into a runnable program ߜ The GCC compiler recommended and used in this book combines the compiling and linking steps An object file is created by GCC, but it is automatically deleted... dentistry final exam 14 1 What’s up, Sally? .14 2 The confounding magic-pellets problem .14 4 Using parentheses to mess up the order of precedence .14 5 Chapter 12 : C the Mighty if Command 14 7 If Only 14 7 The computer-genie program example 14 8 The if keyword, up close and impersonal .15 0 A question of formatting the if statement .15 4 The final . Amok 13 1 Chapter 11 : C More Math and the Sacred Order of Precedence 13 3 Chapter 12 : C the Mighty if Command 14 7 Chapter 13 : What If C= =C? 16 5 Chapter 14 : Iffy C Logic 17 5 Chapter 15 : C You. Again 18 5 Chapter 16 : C the Loop, C the Loop++ 2 01 Chapter 17 : C You in a While Loop 215 Chapter 18 : Do C While You Sleep 225 Chapter 19 : Switch Case, or, From C to Shining c 239 Part IV: C Level. . . . .12 1 The Other Kind of Variable Type, the char 12 1 Single-character variables 12 2 Char in action 12 3 Stuffing characters into character variables 12 4 01 570684 FM.qxd 3/ 31/ 04 2: 51 PM Page

Ngày đăng: 12/08/2014, 09:21

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan