This module contains several examples demonstrating various C programming concepts.
- helloworld.c: A simple program that prints "hello world" to the console.
- errnoexample.c: Demonstrates the use of the
errno
variable to handle errors when opening a file. It prints error messages usingperror
andstrerror
.
- assertexample.c: Shows how to use assertions to validate conditions in a program. It includes a function to test the type of a triangle based on its sides and uses assertions to ensure the sides form a valid triangle.
- exitflows.c: Illustrates the use of
atexit
,at_quick_exit
, andabort
functions to handle different exit flows in a program. It registers functions to be called on normal and quick exits and demonstrates the use ofexit
,quick_exit
, andabort
.