Procedural Programming with C
Undergraduate course, University of Giresun, Department of Computer Engineering, 2023
C is a robust and flexible programming language employed in numerous applications, ranging from operating systems and embedded systems to game development and high-performance computing. As a low-level language, it offers significant control over hardware and memory management, enabling developers to write highly efficient and optimized code. This level of control makes it perfect for performance-critical tasks where speed and resource management are paramount. Its influence is also seen in many modern languages, which have adopted its syntax and features, solidifying C’s role as a foundational language in computer science and software development.
Chapter 1: Introduction to C Programming
- Origins and evolution of the C language
- Features and benefits of using C
- Setting up a development environment
- Basic structure of a C program
- Variables, data types, and operators
- Input and output functions
Compilation process and execution
- Lecture Notes [pdf]
Chapter 2: Control Flow
- Decision-making statements (if, else if, switch)
- Looping statements (for, while, do-while)
Break and continue statements
- Lecture Notes [pdf]
Chapter 3: Arrays and Strings
- Declaring and initializing arrays
- Manipulating arrays: accessing, modifying, and traversing
String manipulation and string library functions
- Lecture Notes [pdf]
Chapter 4: Functions
- Function declaration, definition, and calling
- Function parameters and return values
Recursive functions
- Lecture Notes [pdf]
Chapter 5: Pointers
- Understanding pointers and memory addresses
- Pointer declaration and initialization
- Pointer arithmetic
Dynamic memory allocation (malloc, calloc, free)
- Lecture Notes [pdf]
Chapter 6: Structures
- Structure declaration and initialization
- Accessing structure members
Nested structures and arrays of structures
- Lecture Notes [pdf]
Chapter 7: File Handling
- Working with files in C
- Opening, reading, and writing files
- File positioning and error handling
File I/O using standard libraries
- Lecture Notes [pdf]
Chapter 8: Advanced Data Types
- Enumerations and typedef
- Bitwise operators and bit manipulation
- Bit fields
Unions
- Lecture Notes [pdf]
Chapter 9: Preprocessor Directives
- Macros and their usage
- Conditional compilation
- File inclusion and header files
Debugging using preprocessor directives
- Lecture Notes [pdf]
Chapter 10: Advanced Concepts - Part 1
- Memory management techniques
- Function pointers and callbacks
- Understanding static and dynamic libraries
Recursion: principles and applications
- Lecture Notes [pdf]
Chapter 11: Advanced Concepts - Part 2
- Introduction to data structures (linked lists, stacks, queues)
- Implementation and usage of data structures
- Introduction to algorithms (sorting, searching)
- Time and space complexity analysis
Variadic functions
- Lecture Notes [pdf]
Chapter 12: Error Handling and Debugging
- Common C programming errors
- Debugging techniques and tools
- Exception handling with try-catch blocks
Defensive programming and error handling strategies
- Lecture Notes [pdf]
Chapter 13: Introduction to C++ (Optional)
- Basic differences between C and C++
- Introduction to object-oriented programming
- Classes, objects, and constructors
Basic input/output in C++
- Lecture Notes [pdf]