Cantitate/Preț
Produs

C Programming in One Hour a Day: Microsoft Excel

Autor Bradley L. Jones, Peter Aitken, Dean Miller
en Limba Engleză Paperback – 10 oct 2013

Sams Teach Yourself C in One Hour a Day, Seventh Edition is the newest version of our 500,000+ copy best-seller Sams Teach Yourself C in 21 Days. Fully revised for the new C++11 standard and libraries, it now emphasizes platform-independent C programming using free, open-source C compilers rather than proprietary IDEs. This edition strengthens its focus on C programming fundamentals, and adds new material on C-based object-oriented programming languages (e.g., Objective-C). Replete with carefully explained code, syntax examples, and well-crafted exercises, this is the broadest and deepest introductory C tutorial available. It's ideal for anyone who's serious about truly mastering C - including thousands of developers who want to leverage its speed and performance in modern mobile and gaming apps.

Friendly and accessible, it delivers step-by-step, hands-on experience that starts with simple tasks and gradually builds to professional-quality techniques. Each lesson is designed to be completed in hour or less, introducing and clearly explaining essential concepts, providing practical examples, and encouraging you to build simple programs on your own. Coverage includes:

  • Understanding C program components and structure
  • Mastering essential C syntax and program control
  • Using core language features, including numeric arrays, pointers, characters, strings, structures, and variable scope
  • Interacting with the screen, printer, and keyboard
  • Using functions and exploring the C Function Library
  • Working with memory and the compiler
  • And much more

Citește tot Restrânge

Preț: 24178 lei

Preț vechi: 30222 lei
-20%

Puncte Express: 363

Carte disponibilă

Livrare economică 16-30 octombrie

Livrare prin curier în România Termenul estimat este afișat lângă disponibilitate.
Transport gratuit de la 40000 lei Plată online sau ramburs, în funcție de opțiunile comenzii.
Retur gratuit în 14 zile Comandă securizată și suport în română.

Specificații

ISBN-13: 9780789751997
ISBN-10: 0789751992
Pagini: 672
Dimensiuni: 181 x 233 x 36 mm
Greutate: 1.05 kg
Ediția:7th Edition.
Editura: Sams
Seria Sams Teach Yourself...in One Hour


Cuprins

Introduction 1 PART I: Fundamentals of C LESSON 1: Getting Started with C 5 A Brief History of the C Language ... 6 Why Use C? ... 6 Preparing to Program ... 8 The Program Development Cycle ... 8 Creating the Source Code ... 9 Compiling the Source Code ... 9 Linking to Create an Executable File ... 10 Completing the Development Cycle ... 11 Your First C Program ... 13 Entering and Compiling hello.c ... 14 Summary ... 18 Q&A ... 18 Workshop ... 19 Quiz ... 19 Exercises ... 20 LESSON 2: The Components of a C Program 23 A Short C Program ... 24 The Program's Components ... 25 The main() Function (Lines 9 Through 23) ... 25 The #include and #define Directives (Lines 2 and 3) ... 25 The Variable Definition (Line 5) ... 26 The Function Prototype (Line 7) ... 26 Program Statements (Lines 12, 13, 14, 17, 19, 20, 22, and 28) ... 26 The Function Definition (Lines 26 Through 29) ... 27 Program Comments (Lines 1, 11, 16, and 25) ... 27 Using Braces (Lines 10, 23, 27, and 29) ... 29 Running the Program ... 29 A Note on Accuracy ... 29 A Review of the Parts of a Program ... 30 Summary ... 32 Q&A ... 33 Workshop ... 33 Quiz ... 33 Exercises ... 34 LESSON 3: Storing Information: Variables and Constants 37 Understanding Your Computer's Memory ... 38 Storing Information with Variables ... 39 Variable Names ... 39 Numeric Variable Types... 40 Variable Declarations... 44 The typedef Keyword ... 45 Initializing Variables ... 45 Constants ... 47 Literal Constants ... 47 Symbolic Constants ... 48 Summary ... 53 Q&A ... 53 Workshop ... 54 Quiz ... 54 Exercises ... 55 LESSON 4: The Pieces of a C Program: Statements, Expressions, and Operators 57 Statements ... 58 The Impact of White Space on Statements ... 58 Creating a Null Statement ... 59 Working with Compound Statements ... 59 Understanding Expressions ... 60 Simple Expressions ... 60 Complex Expressions... 60 Operators... 61 The Assignment Operator ... 62 The Mathematical Operators ... 62 Operator Precedence and Parentheses ... 67 Order of Subexpression Evaluation ... 69 The Relational Operators ... 70 The if Statement ... 71 The else Clause ... 74 Evaluating Relational Expressions ... 77 The Precedence of Relational Operators ... 79 The Logical Operators ... 80 More on True/False Values ... 82 The Precedence of Operators ... 82 Compound Assignment Operators ... 84 The Conditional Operator ... 85 The Comma Operator ... 85 Operator Precedence Revisited ... 86 Summary ... 87 Q&A ... 88 Workshop ... 88 Quiz ... 89 Exercises ... 89 LESSON 5: Packaging Code in Functions 91 Understanding Functions ... 92 A Function Defined ... 92 A Function Illustrated ... 92 How a Function Works ... 95 Functions and Structured Programming ... 97 The Advantages of Structured Programming ... 97 Planning a Structured Program ... 97 The Top-Down Approach ... 99 Writing a Function ... 100 The Function Header ... 100 The Function Body ... 103 The Function Prototype ... 109 Passing Arguments to a Function ... 110 Calling Functions ... 110 Recursion ... 112 Where the Functions Belong ... 114 Working with Inline Functions ... 115 Summary ... 115 Q&A ... 116 Workshop ... 116 Quiz ... 116 Exercises ... 117 LESSON 6: Basic Program Control 119 Arrays: The Basics ... 120 Controlling Program Execution ... 121 The for Statement ... 121 Nesting for Statements ... 127 The while Statement ... 130 Nesting while Statements ... 134 The do...while Loop ... 136 Nested Loops ... 141 Summary ... 142 Q&A ... 142 Workshop ... 143 Quiz ... 143 Exercises ... 143 LESSON 7: Fundamentals of Reading and Writing Information 145 Displaying Information Onscreen ... 146 The printf() Function ... 146 The printf() Format Strings ... 146 Displaying Messages with puts() ... 155 Inputting Numeric Data with scanf() ... 156 Using Trigraph Sequences ... 161 Summary ... 162 Q&A ... 163 Workshop ... 163 Quiz ... 163 Exercises ... 164 PART II: Putting C to Work LESSON 8: Using Numeric Arrays 167 What Is an Array? ... 168 Using Single-Dimensional Arrays ... 169 Using Multidimensional Arrays ... 173 Naming and Declaring Arrays ... 174 Initializing Arrays ... 178 Initializing Multidimensional Arrays... 179 Summary ... 182 Q&A ... 183 Workshop ... 184 Quiz ... 184 Exercises ... 184 LESSON 9: Understanding Pointers 187 What Is a Pointer? ... 188 Your Computer's Memory ... 188 Creating a Pointer ... 188 Pointers and Simple Variables ... 189 Declaring Pointers ... 189 Initializing Pointers ... 190 Using Pointers ... 190 Pointers and Variable Types... 193 Pointers and Arrays ... 194 The Array Name as a Pointer ... 194 Array Element Storage ... 195 Pointer Arithmetic ... 198 Pointer Cautions ... 202 Array Subscript Notation and Pointers ... 203 Passing Arrays to Functions ... 204 Summary ... 209 Q&A ... 210 Workshop ... 210 Quiz ... 210 Exercises ... 211 LESSON 10: Working with Characters and Strings 213 The char Data Type ... 214 Using Character Variables ... 215 Using Strings ... 218 Arrays of Characters ... 218 Initializing Character Arrays ... 219 Strings and Pointers ... 219 Strings Without Arrays ... 220 Allocating String Space at Compilation ... 220 The malloc() Function ... 221 Using the malloc() Function ... 222 Displaying Strings and Characters ... 226 The puts() Function ... 226 The printf() Function ... 227 Reading Strings from the Keyboard ... 228 Inputting Strings Using the gets() Function ... 228 Inputting Strings Using the scanf() Function ... 232 Summary ... 235 Q&A ... 235 Workshop ... 237 Quiz ... 237 Exercises ... 238 LESSON 11: Implementing Structures, Unions, and TypeDefs 241 Working with Simple Structures ... 242 Defining and Declaring Structures ... 242 Accessing Members of a Structure ... 243 Using Structures That Are More Complex ... 246 Including Structures Within Other Structures ... 246 Structures That Contain Arrays ... 250 Arrays of Structures ... 252 Initializing Structures ... 256 Structures and Pointers ... 259 Including Pointers as Structure Members ... 259 Creating Pointers to Structures ... 261 Working with Pointers and Arrays of Structures ... 264 Passing Structures as Arguments to Functions ... 267 Understanding Unions ... 268 Defining, Declaring, and Initializing Unions ... 269 Accessing Union Members ... 269 Creating Synonyms for Structures with typedef... 274 Summary ... 275 Q&A ... 275 Workshop ... 276 Quiz ... 276 Exercises ... 277 LESSON 12: Understanding Variable Scope 279 What Is Scope? ... 280 A Demonstration of Scope ... 280 The Importance of Scope ... 282 Creating External Variables ... 282 External Variable Scope ... 283 When to Use External Variables ... 283 The extern Keyword ... 283 Creating Local Variables ... 285 Static Versus Automatic Variables ... 285 The Scope of Function Parameters ... 288 External Static Variables ... 289 Register Variables ... 289 Local Variables and the main() Function ... 290 Which Storage Class Should You Use? ... 291 Local Variables and Blocks ... 291 Summary ... 293 Q&A ... 293 Workshop ... 294 Quiz ... 294 Exercises ... 295 LESSON 13: Advanced Program Control 299 Ending Loops Early ... 300 The break Statement ... 300 The continue Statement ... 302 The goto Statement ... 304 Infinite Loops ... 307 The switch Statement ... 311 Exiting the Program ... 320 The exit() Function ... 320 Summary ... 321 Q&A ... 321 Workshop ... 322 Quiz ... 322 Exercises ... 322 LESSON 14: Working with the Screen, Printer, and Keyboard 325 Streams and C ... 326 What Exactly Is Program Input/Output? ... 326 What Is a Stream? ... 326 Text Versus Binary Streams ... 327 Predefined Streams ... 327 Using C's Stream Functions ... 328 An Example ... 329 Accepting Keyboard Input ... 329 Character Input ... 330 Working with Formatted Input ... 338 Controlling Output to the Screen ... 347 Character Output with putchar(), putc(), and fputc() ... 347 Using puts() and fputs() for String Output... 349 Using printf() and fprintf() for Formatted Output ... 350 When to Use fprintf() ... 357 Using stderr ... 357 Summary ... 358 Q&A ... 359 Workshop ... 359 Quiz ... 359 Exercises ... 360 PART III: Advanced C LESSON 15: Pointers to Pointers and Arrays of Pointers 361 Declaring Pointers to Pointers ... 362 Pointers and Multidimensional Arrays ... 363 Working with Arrays of Pointers ... 372 Strings and Pointers: A Review ... 372 Declaring an Array of Pointers to Type char ... 373 Pulling Things Together with an Example ... 375 Summary ... 381 Q&A ... 382 Workshop ... 382 Quiz ... 382 Exercises ... 383 LESSON 16: Pointers to Functions and Linked Lists 385 Working with Pointers to Functions... 386 Declaring a Pointer to a Function ... 386 Initializing and Using a Pointer to a Function ... 387 Understanding Linked Lists ... 396 Basics of Linked Lists ... 396 Working with Linked Lists ... 398 A Simple Linked List Demonstration ... 403 Implementing a Linked List ... 406 Summary ... 415 Q&A ... 415 Workshop ... 415 Quiz ... 415 Exercises ... 416 LESSON 17: Using Disk Files 417 Relating Streams to Disk Files ... 418 Understanding the Types of Disk Files ... 418 Using Filenames ... 418 Opening a File ... 419 Writing and Reading File Data ... 423 Formatted File Input and Output ... 424 Character Input and Output ... 428 Direct File Input and Output ... 431 File Buffering: Closing and Flushing Files ... 435 Understanding Sequential Versus Random File Access ... 436 The ftell() and rewind() Functions ... 437 The fseek() Function ... 440 Detecting the End of a File ... 443 File Management Functions ... 445 Deleting a File ... 445 Renaming a File ... 446 Copying a File ... 447 Using Temporary Files ... 450 Summary ... 452 Q&A ... 452 Workshop ... 453 Quiz ... 453 Exercises ... 454 LESSON 18: Manipulating Strings 455 Determining String Length ... 456 Copying Strings ... 457 The strcpy() Function ... 457 The strncpy() Function ... 459 Concatenating Strings ... 461 Using the strcat() Function ... 461 Using the strncat() Function ... 462 Comparing Strings ... 464 Comparing Two Entire Strings ... 464 Comparing Partial Strings ... 466 Searching Strings ... 468 The strchr() Function ... 468 The strrchr() Function ... 470 The strcspn() Function ... 470 The strspn() Function ... 471 The strpbrk() Function ... 473 The strstr() Function ... 473 String-to-Number Conversions ... 474 Converting Strings to Integers ... 475 Converting Strings to Longs ... 475 Converting Strings to Long Longs ... 476 Converting Strings to Floating-Point Numeric Values ... 476 Character-Test Functions ... 477 ANSI Support for Uppercase and Lowercase ... 481 Summary ... 483 Q&A ... 483 Workshop ... 484 Quiz ... 484 Exercises ... 484 LESSON 19: Getting More from Functions 487 Passing Pointers to Functions ... 488 Type void Pointers ... 492 Using Functions That Have a Variable Number of Arguments ... 496 Functions That Return a Pointer ... 499 Summary ... 501 Q&A ... 502 Workshop ... 502 Quiz ... 502 Exercises ... 503 LESSON 20: Exploring the C Function Library 505 Mathematical Functions ... 506 Trigonometric Functions ... 506 Exponential and Logarithmic Functions ... 506 Hyperbolic Functions ... 507 Other Mathematical Functions ... 507 A Demonstration of the Math Functions ... 508 Dealing with Time ... 509 Representing Time ... 509 The Time Functions ... 510 Using the Time Functions ... 513 Error-Handling ... 516 The assert() Macro ... 516 The errno.h Header File ... 518 The perror() Function ... 519 Searching and Sorting ... 521 Searching with bsearch() ... 521 Sorting with qsort()... 523 Searching and Sorting: Two Demonstrations ... 523 Summary ... 529 Q&A ... 529 Workshop ... 530 Quiz ... 530 Exercises ... 531 LESSON 21: Working with Memory 533 Type Conversions ... 534 Automatic Type Conversions ... 534 Explicit Conversions Using Typecasts ... 536 Allocating Memory Storage Space ... 538 Allocating Memory with the malloc() Function ... 539 Allocating Memory with the calloc() Function ... 540 Allocating More Memory with the realloc() Function ... 541 Releasing Memory with the free() Function ... 543 Manipulating Memory Blocks ... 545 Initializing Memory with the memset() Function ... 545 Copying Memory with the memcpy() Function ... 546 Moving Memory with the memmove() Function ... 546 Working with Bits ... 548 The Shift Operators ... 548 The Bitwise Logical Operators ... 550 The Complement Operator ... 552 Bit Fields in Structures ... 552 Summary ... 554 Q&A ... 554 Workshop ... 556 Quiz ... 556 Exercises ... 557 LESSON 22: Advanced Compiler Use 559 Programming with Multiple Source-Code Files ... 560 Advantages of Modular Programming ... 560 Modular Programming Techniques ... 560 Module Components ... 564 External Variables and Modular Programming ... 565 The C Preprocessor ... 567 The #define Preprocessor Directive ... 567 Using the #include Directive ... 572 Using #if, #elif, #else, and #endif ... 573 Using #if...#endif to Help Debug ... 574 Avoiding Multiple Inclusions of Header Files... 575 The #undef Directive ... 576 Predefined Macros ... 576 Using Command-Line Arguments ... 577 Summary ... 580 Q&A ... 580 Workshop ... 581 Quiz ... 581 Exercises ... 582 PART 4: Appendixes APPENDIX A: ASCII Chart 583 APPENDIX B: C/C++ Reserved Words 589 APPENDIX C: Common C Functions 593 APPENDIX D: Answers 599 TOC, 9780789751997, 9/16/2013

Notă biografică

Bradley L. Jones manages and directs the Developer.com Network, which includes sites such as Developer.com, CodeGuru, and DevX. He has developed systems using C, C#, C++, SQL Server, PowerBuilder, Visual Basic, HTML5, and more. Peter Aitken was on the faculty at Duke University Medical Center, where he cut his programming teeth developing computer programs for research. He is an experienced author in the IT field-on both applications and programming topics-with more than 70 magazine articles and 40 books to his credit. Aitken currently works as a consultant in the pharmaceutical industry. Dean Miller is a writer and editor with more than 20 years of experience in both the publishing and licensed consumer product businesses. Over the years, he has created or helped shape a number of bestselling books and series, including Teach Yourself in 21 Days, Teach Yourself in 24 Hours, and the Unleashed series, all from Sams Publishing.