C

23 articles in this topic

Memory Management in C: Stack, Heap, malloc, calloc, realloc and free with a Worked Example

Learn how C object lifetimes, allocation functions, ownership, bounds, and cleanup fit together through a complete resizable-array example.

Updated 4 Sep 20266 min readC

Dynamic Memory Allocation in C: malloc, calloc, realloc and free with a Worked Example

A runnable marks example shows how C requests, initializes, grows and releases runtime storage, with checked byte counts, ownership and safe realloc handling.

Updated 2 Sep 20265 min readC

Operator Overloading in C++: Syntax, Rules, and Worked Examples

Learn what C++ calls for an overloaded operator, then test addition, stream output, increment, and fraction comparison with exact values.

Updated 31 Aug 20266 min readC

Inheritance in C++ Tutorial: Types, Access Modes and Runnable Examples

Learn what a derived class receives from its base, how access modes transform members, and how construction and virtual dispatch work through runnable examples.

Updated 30 Aug 20265 min readC

Constructors and Destructors in C++: Object Lifetime with Runnable Examples

Trace constructor selection, copying, scope exit, reverse destruction, and RAII through two complete C++17 programs with exact output and memory diagrams.

Updated 29 Aug 20266 min readC

Classes and Objects in C++: Beginner Tutorial with Runnable Examples

Build a precise mental model of C++ classes and objects with two Rectangles, a checked setter, exact output traces, common error fixes, and short exercises.

Updated 26 Aug 20266 min readC

Strings in C++: Beginner Tutorial with Runnable Examples

Learn how std::string behaves through exact outputs, safe input patterns, a worked index trace, common traps, and three short practice problems.

Updated 25 Aug 20265 min readC

References in C++: Syntax, Aliasing, and Runnable Examples

Build a reliable mental model of C++ references through state traces, parameter examples, const binding, pointer comparisons, and common error repairs.

Updated 23 Aug 20266 min readC

Memory Layout of a C Program: Stack, Heap, Data, BSS and Text Explained

Place globals, static objects, literals, local variables, pointers and allocated values correctly using one runnable C program and an illustrative ELF/Linux map.

Updated 21 Aug 20266 min readC

C++ Setup Tutorial: Install a Compiler and Run Your First Program

Set up a C++ compiler, turn main.cpp into an executable, and learn to diagnose the stage that failed. Two small programs make every command and value concrete.

Updated 20 Aug 20266 min readC

Header Files and Linking in C: Build a Multi-File Program Step by Step

Build and debug a three-file C program while learning where declarations, definitions, external symbols, and storage belong.

Updated 18 Aug 20266 min readC

C to C++ Transition: Syntax Changes, Classes and Runnable Examples

Move a working C record into an encapsulated C++ class, then replace common pointer, buffer, and allocation patterns with clearer C++ alternatives.

Updated 16 Aug 20267 min readC