Category Archives: C Programming

Chapter 53: Multi-Character Character Sequence

Section 53.1: Trigraphs The symbols [ ] { } ^ \ | ~ # are frequently used in C programs, but in the…
Continue reading

Chapter 52: Side Eects

Section 52.1: Pre/Post Increment/Decrement operators In C, there are two unary operators - '++' and '--' that are very common source of confusion.…
Continue reading

Chapter 51: — character classification & conversion

Section 51.1: Introduction The header ctype.h is a part of the standard C library. It provides functions for classifying and converting characters. All…
Continue reading

Chapter 50: Create and include header files

In modern C, header files are crucial tools that must be designed and used correctly. They allow the compiler to cross-check independently compiled…
Continue reading

Chapter 49: Jump Statements

Section 49.1: Using return Returning a value One commonly used case: returning from main() #include <stdlib.h> /* for EXIT_xxx macros */ int main(int…
Continue reading

Chapter 48: Atomics

Section 48.1: atomics and operators Atomic variables can be accessed concurrently between different threads without creating race conditions. /* a global static variable…
Continue reading

Chapter 47: Implementation-defined behaviour

Section 47.1: Right shift of a negative integer int  signed_integer  =  -1; // The right shift operation exhibits implementation-defined behavior: int  result  =…
Continue reading

Chapter 46: Memory management

name                                                                             description For managing dynamically allocated memory, the standard C library provides the functions malloc(), calloc(), realloc() and free(). In C99 and later,…
Continue reading

Chapter 45: Structure Padding and Packing

By default, C compilers lay out structures so that each member can be accessed fast, without incurring penalties for 'unaligned access, a problem…
Continue reading

Chapter 44: Declarations

Section 44.1: Calling a function from another C file foo.h #ifndef  FOO_DOT_H /* This is an "include guard" */ #define FOO_DOT_H /* prevents…
Continue reading