Results for “bound”
Small, practical examples. Search by task or narrow things down below.
Copy a string with a guaranteed terminator
Arduino / C: Reserve one character for the terminator when copying a bounded string.
Arduino / C✓ Tested
Detect truncated formatted output
Arduino / C: snprintf returns the length it would have written, excluding the null terminator.
Arduino / C✓ Tested
Extract a section of an Arduino String
Arduino / C: substring includes the start index and excludes the end index.
Arduino / C✓ Tested
Find the insertion position for a sorted value
C++: lower_bound returns the first position whose value is not less than the search key.
C++✓ Tested
Format several integers in a fixed buffer
Arduino / C: snprintf limits writes to the buffer size and includes a terminating null byte.
Arduino / C✓ Tested
Keep a serial message in flash memory
Arduino / C: The F macro keeps a literal out of scarce SRAM.
Arduino / C✓ Tested
Limit a numeric input to an inclusive range
HTML: Number inputs expose range validation separately from the entered text.
HTML✓ Tested
Reject an integer with trailing characters
Arduino / C: strtol exposes an end pointer so a parser can require the entire token.
Arduino / C✓ Tested
Reject insertion when a fixed queue is full
Arduino / C: Track a count separately from circular read and write positions.
Arduino / C✓ Tested
Replace a token inside an Arduino String
Arduino / C: replace modifies all occurrences in the existing object.
Arduino / C✓ Tested
Split a writable comma-delimited buffer
Arduino / C: strtok modifies its buffer and returns successive tokens.
Arduino / C✓ Tested
Trim surrounding whitespace from an Arduino String
Arduino / C: String.trim modifies the object in place.
Arduino / C✓ Tested