Error Logging System

Hard
2 views 24 Jan 2026
Maintain a global error log. Log each error to a file with a timestamp. Combine printf(sderror) and file writing....

Graceful Degradation

Hard
2 views 24 Jan 2026
Create a program that loads data using the primary method. If it fails, create a fallback method. Multiple levels of error handling....

Errno Explorer

Hard
2 views 24 Jan 2026
Make system calls (write file operations) fail deliberately. Print the value of errno and the message from strerror() on each failure. Understand the pattern....

Multiple Error Codes

Hard
2 views 24 Jan 2026
Create a function that can return different error types: success=0, null_pointer=-1, out_of_bounds=-2, invalid_input=-3. Use enums for readability....

Assert for Debugging

Medium
3 views 24 Jan 2026
Verify assemblies in critical functions using assert(). Example: pointer must not be null. Enabled in debug builds, disabled in release builds....

Array Bounds Validator

Medium
3 views 24 Jan 2026
Create a function that accesses the array. Validate the index parameter - if out of bounds return error, allow valid access....

Input Validation Loop

Medium
3 views 24 Jan 2026
Takes positive integer input from the user. If negative or zero is entered, return an error message and retry. Check the return value for invalid input....

Memory Allocation Checker

Easy
3 views 24 Jan 2026
Allocate memory with malloc(). If NULL is returned (allocation failed) to handle the error, clean the memory that has already been allocated. Resource cleanup....

File Open Error Handler

Easy
2 views 24 Jan 2026
Open the file. If null is returned, check errno and print the specific error message (file not found, permission denied, etc.). perror() does that....

Safe Division Function

Easy
3 views 24 Jan 2026
Create a function that performs division but first checks for zero. If the denominator is zero, return an error code and do not write a value to the result pointer....