Skip to content

ricardolq/icp1_s2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e567b1c · Mar 1, 2025

History

8 Commits
Mar 1, 2025
Mar 1, 2025
Sep 5, 2024
Mar 1, 2025
Mar 1, 2025

Repository files navigation

Module 1 - Session 2 - Examples

This module contains several examples demonstrating various C programming concepts.

sample1_hello

  • helloworld.c: A simple program that prints "hello world" to the console.

sample2_errno

  • errnoexample.c: Demonstrates the use of the errno variable to handle errors when opening a file. It prints error messages using perror and strerror.

sample3_assertions

  • 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.

sample4_exitflows

  • exitflows.c: Illustrates the use of atexit, at_quick_exit, and abort functions to handle different exit flows in a program. It registers functions to be called on normal and quick exits and demonstrates the use of exit, quick_exit, and abort.

About

S2 Assertions & Error handling

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published