1. Trang chủ
  2. » Công Nghệ Thông Tin

C For Dummies pot

411 198 0

Đ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

Thông tin cơ bản

Định dạng
Số trang 411
Dung lượng 9,76 MB

Nội dung

[...]... 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... 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... 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... disk The file contains instructions for the computer that are written in the C programming language ߜ You use a text editor to create the source code file See Appendix A for more information on text editors Creating the GOODBYE .C source code file Use your text editor to create the following source code Carefully type each line exactly as written; everything you see below is important and necessary Don’t... into character variables 124 xi xii C For Dummies, 2nd Edition Reading and Writing Single Characters .125 The getchar() function 126 The putchar() function 127 Character Variables As Values 128 Part III: Giving Your Programs the Ability to Run Amok .131 Chapter 11: C More Math and the Sacred Order of Precedence 133 An All-Too-Brief Review of the Basic C Mathematical... sections describe how the process works After all, you can just pick up the mouse and say “Hello, computer!” ߜ Programming is what TV network executives do Computer programmers code ߜ You use a programming language to communicate with the computer, telling it exactly what to do The source code (text file) Because the computer can’t understand speech and, well, whacking the computer — no matter how emotionally... big, and only so much ground could be covered, given this book’s gentle pace Because of that, those interested in pursuing the C language further should check out the companion book, C All-in-One Desk Reference For Dummies (Wiley) That book is for more experienced program­ mers, which is what you will become after reading this book Final Thots Understanding how to use C is an ongoing process Only a dweeb... Part 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... delay to the COUNTDWN .C program 231 The nitty GRID .C of nested loops .234 Break the Brave and Continue the Fool 235 Please continue 236 The continue keyword .237 Chapter 19: Switch Case, or, From C to Shining c 239 The Sneaky switch-case Loops .239 The switch-case Solution to the LOBBY Program .241 The Old switch-case Trick ... automatically deleted when the final program file is created ߜ Object code files end in OBJ or sometimes just O The first part of the object file name is the same as the source code filename ߜ Feel free to cheerfully forget all this object code nonsense for now ߜ Text editor➪Compiler ߜ Source code➪Program Compiling GOODBYE .C The gritty details for compiling a program are in Appendix A Assuming that . Amok 131 Chapter 11: C More Math and the Sacred Order of Precedence 133 Chapter 12: C the Mighty if Command 147 Chapter 13: What If C= =C? 165 Chapter 14: Iffy C Logic 175 Chapter 15: C You Again. Primordial C 9 Chapter 2: C of Sorrow, C of Woe 19 Chapter 3: C Straight 29 Chapter 4: C What I/O 39 Chapter 5: To C or Not to C 55 Chapter 6: C More I/O with gets() and puts() 65 Part II: Run and Scream. Mary C. Corder, Editorial Director Publishing for Consumer Dummies Diane Graves Steele, Vice President and Publisher Joyce Pepple, Acquisitions Director Composition Services Gerry Fahey, Vice

Ngày đăng: 27/06/2014, 09:20

Xem thêm

TỪ KHÓA LIÊN QUAN