Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Test MDX File V3

This is a Test MDX File for my Code Gap Check setup. Test callout:

C++ is a powerful, object-oriented programming language that has played a significant role in software development since its inception. Developed by Bjarne Stroustrup at Bell Labs (now AT&T Labs) between 1983 and 1985, C++ built upon the foundations of the C language. C itself has a rich lineage, tracing back to the B language (1970) by Ken Thompson and ultimately to the BCPL language.

Concept Match

Match C++ Memory Concepts

Drag each definition into its matching concept slot, then click Submit. Tap × to return a placed card to the pool.

Stack
drag a definition here…
Heap
drag a definition here…
volatile
drag a definition here…
const
drag a definition here…

Definition Pool

Manually managed region used for dynamic allocation via new/delete.
Prevents the compiler optimising reads of a hardware-modified variable.
Automatically managed memory for locals; freed on scope exit.
Marks a variable as read-only after initialisation.

Here is an example of a Code Order exercise (C++), expanded by default …

Code Order
C++

Arrange a Hello World Program

Drag the tiles to arrange the code in the correct order, then click Submit. Locked lines stay in place. Indentation is dynamically applied based on the location of braces.
return 0;
using namespace std;
int main() {
cout << "Hello world!\n";
#include <iostream>
}

Here is a Code Order exercise (Rust), collapsed by default … The opening fn main() { and the closing } are locked — the puzzle is really about assembling the iterator chain in the right order.

Code Order
Rust

Build a Rust Iterator Chain

The lab below is pre-loaded with the textbook example: float a = 25.0;, int b = 545;, and double c = 123.0;. Drag any type from the palette onto the memory strip to allocate it. Click a placed variable to rename it or change its value.

C++ Memory Lab

Drag a type onto memory and watch the variable claim the bytes its size demands.

Memorybase = 0x1000
16 / 16 bytes used0 free
+0
+4
+8
+C
a
25.0
b
545
c
123.0
byte 0
4
8
12

Type Palette — drag onto memory

bool8-bit
char8-bit
short16-bit
int32-bit
unsigned int32-bit
long64-bit
unsigned long64-bit
float32-bit
double64-bit
integer types
floating point
character
boolean

Declared variables

TypeNameValueAddressSize
floata25.00x10000x10034 bytes (32-bit)
intb5450x10040x10074 bytes (32-bit)
doublec123.00x10080x100F8 bytes (64-bit)
Try this:Click Textbook example to load a, b, c. Then drag a char onto memory — notice it claims a single byte, same as a bool, while double claims eight. Click any placed variable to rename it or change its value. With 16 bytes of memory there's no room for all five textbook variables at once — that's the point: char and bool are cheap, double is expensive.

Same lab, but with a smaller memory region (8 bytes) and a different base address — useful when showing how a single double fills the entire visible region.

Tight Memory (8 bytes)

Drag a type onto memory and watch the variable claim the bytes its size demands.