Results for “C++”
Small, practical examples. Search by task or narrow things down below.
Insert into an array with spare capacity
C: Move the trailing elements before inserting and keep the logical length separate from capacity.
C✓ Tested
Insert or update on a key conflict
Use a unique key to update an existing row.
ON CONFLICT✓ Tested
Inspect a byte as hexadecimal
Arduino / C: Inspect a byte as hexadecimal on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Inspect a byte without consuming it
Arduino / C: peek leaves the next byte available for a later read.
Arduino / C✓ Tested
Inspect a clean working tree
Git: Inspect a clean working tree inside the disposable repository created by the input setup.
Git✓ Tested
Inspect a completed container’s exit code
Docker / Compose: Inspect a completed container’s exit code using a locally available Ubuntu image.
Docker / Compose✓ Tested
Inspect a deferred’s lifecycle state
jQuery: state reports pending, resolved, or rejected.
jQuery✓ Tested
Inspect a file length without reading it
C#: Use FileInfo.Length to retrieve a logical size in bytes.
C#✓ Tested
Inspect a GitHub remote URL
Configure and inspect an example origin without contacting the network.
GitHub✓ Tested
Inspect a parsed URI
C#: Use Uri properties instead of splitting URL strings manually.
C#✓ Tested
Inspect a path’s filename and extension
Inspect a path’s filename and extension in a complete Rust program using the standard library.
Rust✓ Tested
Inspect a revision with detached HEAD
Git: Detached mode is useful for inspection; create a branch before keeping new work.
Git✓ Tested