FIND YOUR NEXT FEW LINES

Results for “read text”

Small, practical examples. Search by task or narrow things down below.

836 snippets foundClear filters
CStructures & function interfaces

Track which union member is currently valid

C: An explicit tag tells callers which overlaid union value to read.

C✓ Tested
C++Ownership & optional values

Transfer unique ownership with move

C++: Moving a unique_ptr leaves the source empty and gives ownership to the destination.

C++✓ Tested
C++Sequence algorithms

Transform a vector into a separate result

C++: Pre-size the output before writing through its iterator.

C++✓ Tested
TypeScriptUtilities & async

Type an object update with Partial

Allow a caller to provide just the fields to change.

Partial✓ Tested
C++Containers & compound values

Unpack a tuple with structured bindings

C++: Structured bindings give names to the parts of a returned compound value.

C++✓ Tested
SQL ServerJSON & results

Update a JSON property

Create updated JSON text with JSON_MODIFY.

JSON_MODIFY✓ Tested
C++Getting Started

Update a running count

C++: Change a variable after its initial value has been assigned.

C++✓ Tested
Bash ScriptsVariables & text

Use a default value for an unset variable

Supply a fallback without changing the original variable.

parameter expansion✓ Tested
C++Containers & compound values

Use a fixed-size container with bounds checking

C++: std::array retains its element count and supports checked access through at.

C++✓ Tested
C++Containers & compound values

Use a hash map for direct key lookup

C++: unordered_map provides key lookup without promising iteration order.

C++✓ Tested
C++Containers & compound values

Use a last-in first-out stack

C++: Read top before pop because pop does not return the removed value.

C++✓ Tested
Arduino / CArrays & embedded state

Use named states for a controller

Arduino / C: An enum makes state transitions easier to read than unexplained numbers.

Arduino / C✓ Tested