## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

## Book Description

Designed for a compulsory fundamental course, C: From Theory to Practice uses a hands-on approach to teach the C programming language, using numerous examples and a clear, concise presentation. Easy to use and classroom tested, this textbook includes more than 500 exercises and examples of progressive difficulty to help students in understanding al

1. Preface
2. Acknowledgments
3. Authors
4. Chapter 1 - Introduction to C
1. History of C
2. ANSI Standard
5. C Program Life Cycle
6. Write a C Program
7. First C Program
8. Compilation
10. Run the Program
11. Reference
5. Chapter 2 - Data Types, Variables, and Data Output
1. Variables
2. Rules for Naming Variables
3. Variable Name Conventions
4. Declaring Variables
5. Assigning Values to Variables
6. Constants
7. #define Directive
8. printf() Function
1. Escape Sequences
2. Conversion Specifications
3. Return Value
4. Printing Variables
5. Optional Fields
9. Type Casting
10. Exercises
11. Unsolved Exercises
6. Chapter 3 - Getting Input with scanf()
1. scanf() Function
2. Exercises
3. Unsolved Exercises
7. Chapter 4 - Operators
1. Assignment Operator
2. Arithmetic Operators
3. Increment and Decrement Operators
4. Relational Operators
5. Exercises
6. Not Operator !
7. Exercises
8. Compound Operators
9. Exercise
10. Logical Operators
11. Exercises
12. Comma Operator
13. Exercise
14. sizeof Operator
15. enum Type
16. Bitwise Operators
17. Exercise
18. Shift Operators
19. Exercises
20. Operator Precedence
21. Unsolved Exercises
8. Chapter 5 - Program Control
1. if Statement
2. if-else Statement
3. Nested if Statements
4. Exercises
5. Conditional Operator ?:
6. Exercises
7. switch Statement
8. Exercises
9. Unsolved Exercises
9. Chapter 6 - Loops
1. for Statement
2. Exercises
3. break Statement
4. continue Statement
5. Exercises
6. Nested Loops
7. Exercises
8. while Statement
9. Exercises
10. do-while Statement
11. Exercises
12. goto Statement
13. Unsolved Exercises
10. Chapter 7 - Arrays
1. Declaring Arrays
2. Accessing Array Elements
3. Array Initialization
4. Exercises
5. Two-Dimensional Arrays
6. Exercises
7. Unsolved Exercises
11. Chapter 8 - Pointers
1. Pointers and Memory
2. Declaring Pointers
3. Pointer Initialization
4. NULL Value
5. Use a Pointer
6. Exercises
7. void* Pointer
8. Use of const Keyword
9. Pointer Arithmetic
10. Exercises
11. Pointers and Arrays
12. Exercises
13. Arrays of Pointers
14. Exercises
15. Pointer to Pointer
16. Exercises
17. Pointers and Two-Dimensional Arrays
18. Exercises
19. Pointer to Function
20. Exercise
21. Array of Pointers to Functions
22. Unsolved Exercises
12. Chapter 9 - Characters
13. Chapter 10 - Strings
1. String Literals
2. Storing Strings
3. Exercises
4. Writing Strings
5. Exercise
6. Pointers and String Literals
7. Exercises
9. For a Safe Reading of Strings
10. Exercises
11. String Functions
12. Exercises
13. Exercises
14. Exercises
15. Two-Dimensional Arrays and Strings
16. Exercises
17. Unsolved Exercises
14. Chapter 11 - Functions
1. Function Declaration
2. Return Type
3. Function Parameters
4. Function Definition
5. return Statement
6. Function Call
7. Exercises
8. Variables Scope
9. Arrays as Arguments
10. Exercises
11. Function Call with Parameter Two-Dimensional Array
12. Exercises
13. Passing Data in main() Function
14. Exercises
15. Functions with Variable Number of Parameters
16. Recursive Functions
17. Exercises
18. Unsolved Exercises
15. Chapter 12 - Searching and Sorting Arrays
1. Searching Arrays
2. Exercises
3. Exercises
4. Sorting Arrays
5. Exercises
6. Exercise
7. Exercise
8. bsearch() and qsort() Library Functions
9. Exercise
16. Chapter 13 - Structures and Unions
1. Structures
2. Exercise
3. Exercises
4. Exercises
5. Unions
6. Exercise
7. Unsolved Exercises
17. Chapter 14 - Memory Management and Data Structures
1. Memory Blocks
2. Static Memory Allocation
3. Dynamic Memory Allocation
4. memcpy() and memmove() Functions
5. memcmp() Function
6. Exercises
7. Dynamic Data Structures
8. Examples
9. Exercise
10. Exercise
11. Exercises
12. Unsolved Exercises
18. Chapter 15 - Files
1. Files in C
2. Open a File
3. Close a File
4. Process a File
5. Write Data in a Text File
6. Exercise
7. Exercises
8. Read Data from a Text File
9. Exercises
10. Exercise
11. Exercises
12. End of File
13. fseek() Function
14. ftell() Function
15. Write and Read Data from a Binary File
16. Exercises
17. Exercises
18. feof() Function
19. Exercise
20. Unsolved Exercises
19. Chapter 16 - Preprocessor Directives and Macros
1. Simple Macros
2. Macros with Parameters
3. # and ## Preprocessor Operators
4. Preprocessor Directives and Conditional Compilation
5. Exercises
6. Unsolved Exercises
20. Chapter 17 - Review Exercises
21. Appendix A
22. Appendix B
23. Appendix C
24. Appendix D
25. Bibliography