ansi-c-balaguruswamy-c-language-PDFDrive.com-_compressed (1).docx
Document Details
Full Transcript
# Programming in C ## Preface to the Fifth Edition ## Overview of C - **1.1 History of C** - **1.2 Importance of C** - **1.3 Sample Program 1: Printing a Message** - **1.4 Sample Program 2: Adding Two Numbers** - **1.5 Sample Program 3: Interest Calculation** - **1.6 Sample Program 4: Use of Su...
# Programming in C ## Preface to the Fifth Edition ## Overview of C - **1.1 History of C** - **1.2 Importance of C** - **1.3 Sample Program 1: Printing a Message** - **1.4 Sample Program 2: Adding Two Numbers** - **1.5 Sample Program 3: Interest Calculation** - **1.6 Sample Program 4: Use of Subroutines** - **1.7 Sample Program 5: Use of Math Functions** - **1.8 Basic Structure of C Programs** - **1.9 Programming Style** - **1.10 Executing a 'C' Program** - **1.11 Unix System** - **1.12 Ms-Dos System** - **Review Questions** - **Programming Exercises** ## 2 Constants, Variables, and Data Types - **2.1 Introduction** - **2.2 Character Set ** - **2.3 C Tokens** - **2.4 Keywords and Identifiers** - **2.5 Constants** - **2.6 Variable**s - **2.7 Data Types** - **2.8 Declaration of Variables** - **2.9 Declaration of Storage Class** - **2.10 Assigning Values to Variables** - **2.11 Defining Symbolic Constants** - **2.12 Declaring a Variable as Constant** - **2.13 Declaring a Variable as Volatile** - **2.14 Overflow and Underflow of Data** - **Review Questions** - **Programming Exercises** ## 3 Operators and Expressions - **3.1 Introduction** - **3.2 Arithmetic Operators** - **3.3 Relational Operators** - **3.4 Logical Operators** - **3.5 Assignment Operators** - **3.6 Increment and Decrement Operators** - **3.7 Conditional Operator** - **3.8 Bitwise Operators** - **3.9 Special Operator**s - **3.10 Arithmetic Expressions** - **3.11 Evaluation of Expressions** - **3.12 Precedence of Arithmetic Operators** - **3.13 Some Computational Problems** - **3.14 Type Conversions in Expression**s - **3.15 Operator Precedence and Associativity** - **3.16 Mathematical Function**s - **Review Questions** - **Programming Exercises** ## 4 Managing Input and Output Operations - **4.1 Introduction** - **4.2 Reading a Character** - **4.3 Writing a Character** - **4.4 Formatted Input** - **4.5 Formatted Output** - **Review Questions** - **Programming Exercise**s ## 5 Decision Making and Branching - **5.1 Introduction** - **5.2 Decision Making with IF Statement** - **5.3 Simple IF Statement** - **5.4 The IF...ELSE Statement** - **5.5 Nesting of IF...ELSE Statements** - **5.6 The ELSE IF Ladder** - **5.7 The Switch Statement** - **5.8 The ? : Operator** - **5.9 The GOTO Statement** - **Review Questions** - **Programming Exercise**s ## 6 Decision Making and Looping - **6.1 Introduction** - **6.2 The WHILE Statement** - **6.3 The FOR Statement** - **6.4 The DO...WHILE Statement** - **6.5 Jumps** - **6.6 Concise Test Expressions** - **Review Questions** - **Programming Exercises** ## 7 Arrays - **7.1 Introduction** - **7.2 One-Dimensional Arrays** - **7.3 Declaration of One-Dimensional Arrays** - **7.4 Initialization of One-Dimensional Arrays** - **7.5 Two-Dimensional Arrays** - **7.6 Initializing Two-Dimensional Arrays** - **7.7 Multidimensional Arrays** - **7.8 Dynamic Arrays** - **7.9 More About Arrays** - **Review Questions** - **Programming Exercises** ## 8 Pointers - **8.1 Introduction** - **8.2 Declaring Pointers** - **8.3 Initializing Pointers** - **8.4 Accessing Contents of Pointers** - **8.5 Assigning Values Using Pointers** - **8.6 Pointer Arithmetic** - **8.7 Pointer to Pointers** - **8.8 Array of Pointers** - **8.9 Advantages of Pointers** - **8.10 Passing Arguments to Function Using Pointers** - **8.11 Returning Addresses from Functions** - **8.12 Relationship Between Array and Pointer** - **8.13 Pointers and Strings** - **8.14 Applications Of Pointers** - **8.15 Dynamic Memory Allocation** - **8.16 The MALLOC() Function** - **8.17 The CALLOC() Function** - **8.18 The REALLOC() Function** - **8.19 The FREE() Function** - **8.20 Memory Leakage** - **Review Questions** - **Programming Exercises** ## 9 Strings - **9.1 Introduction** - **9.2 String Handling** - **9.3 Inputting Strings** - **9.4 Outputting Strings** - **9.5 Strings as Character Array**s - **9.6 String Operations** - **9.7 The strlen() Function** - **9.8 The strcpy() Function** - **9.9 The strcat() Function** - **9.10 The strcmp() Function** - **9.11 The strchr() Function** - **9.12 The strstr() Function** - **9.13 The strcspn() Function** - **9.14 The strpbrk() Function** - **9.15 The strrchr() Function** - **9.16 The strspn() Function** - **9.17 Standard Library String Functions** - **Review Questions** - **Programming Exercises** ## 10 Structures, Unions, and Enumerations - **10.1 Introduction** - **10.2 Structures** - **10.3 Declaring Structures** - **10.4 Initializing Structures** - **10.5 Accessing Members of Structures** - **10.6 Arrays of Structures** - **10.7 Nested Structures** - **10.8 Structures as Function Arguments** - **10.9 Structures as Function Return Value** - **10.10 Unions** - **10.11 Declaring Unions** - **10.12 Initializing Unions** - **10.13 Accessing Members of Unions** - **10.14 Applications of Unions** - **10.15 Enumerations** - **10.16 Declaring Enumerations** - **10.17 Using Enumeration Constants** - **10.18 Applications of Enumerations** - **Review Questions** - **Programming Exercises** ## 11 File Input and Output - **11.1 Introduction** - **11.2 Files** - **11.3 File Pointers** - **11.4 Opening Files** - **11.5 Closing Files** - **11.6 Modes of Opening Files ** - **11.7 Reading Data From Files** - **11.8 Writing Data To Files** - **11.9 Seeking Position in a File** - **11.10 Error Handling** - **11.11 Standard Input and Output** - **11.12 Console Input and Output** - **Review Questions** - **Programming Exercises** ## 12 The Preprocessor - **12.1 Introduction** - **12.2 Preprocessing Directives** - **12.3 The #include Directive** - **12.4 The #define Directive** - **12.5 Macro Substitutions** - **12.6 Macros with Arguments** - **12.7 The #ifdef, #ifndef, and #else Directives** - **12.8 The #undef Directive** - **12.9 The #error Directive** - **12.10 The #pragma Directive** - **12.11 Preprocessing Operations** - **Review Questions** - **Programming Exercises** ## 13 The C Library - **13.1 Introduction** - **13.2 C Library Functions** - **13.3 Character Functions** - **13.4 String Functions** - **13.5 Mathematical Functions** - **13.6 Time and Date Functions** - **13.7 Memory Allocation Functions** - **13.8 Input and Output Functions** - **13.9 File Handling Functions** - **13.10 Searching and Sorting Functions** - **13.11 String Handling** - **13.12 Dynamic Memory Allocation** - **Review Questions** - **Programming Exercises** ## 14 Object-Oriented Programming in C - **14.1 Introduction** - **14.2 Object-Oriented Programming Concepts** - **14.3 Data Abstraction** - **14.4 Encapsulation** - **14.5 Inheritance** - **14.6 Polymorphism** - **14.7 C++ and Object-Oriented Programming** - **Review Questions** - **Programming Exercises** ## 15 Some Advanced Features of C - **15.1 Introduction** - **15.2 Self-Referential Structures** - **15.3 Linked Lists** - **15.4 Creating a Linked List** - **15.5 Traversing a Linked List** - **15.6 Inserting a Node in a Linked List** - **15.7 Deleting a Node from a Linked List** - **15.8 Stacks** - **15.9 Queues** - **15.10 Trees** - **15.11 Graphs** - **15.12 Advanced C Concepts** - **Review Questions** - **Programming Exercises** ## 16 Appendix A: ANSI C Standard - **A.1 Introduction** - **A.2 Characteristics of the C Language Standard** - **A.3 Syntax Summary** - **A.4 Reserved Word List** - **A.5 Language Features.** - **A.4.1 Data Types** - **A.5.1 Types** - **A.5.2 Declarations** - **A.5.3 Functions** - **A.5.4 Program Structure** - **A.5.5 Identifiers** - **A.5.6 Lexical Elements** - **A.5.7 Preprocessing** - **A.5.8 Library Functions** - **A.5.9 Operators and Expressions** - **A.5.10 Statements** - **A.6 Glossary of Technical Terms** - **A.7 ANSI Standard** ## 17 Appendix B: ASCII Character Set - **B.1 Introduction** - **B.2 ASCII Chart** ## 18 Appendix C: The C Grammar - **C.1 Introduction** - **C.2 The C Grammar** ## 19 Index