FIND YOUR NEXT FEW LINES

Results for “z”

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

416 snippets foundClear filters
CArrays

Sum array values

Iterate over a fixed C array using a size-derived element count.

C✓ Tested
TypeScriptCollections & records

Sum typed values with reduce

Accumulate numeric array elements.

reduce✓ Tested
CSmall algorithms & bit operations

Test whether an unsigned value is a power of two

C: A nonzero power of two has exactly one set bit.

C✓ Tested
C#LINQ transformations

Test whether any or all values match

C#: Any and All short-circuit instead of materializing filtered collections.

C#✓ Tested
Arduino / CBinary values & packets

Toggle a bit with an XOR mask

Arduino / C: XOR flips selected bits and leaves all other bits unchanged.

Arduino / C✓ Tested
Arduino / CDigital signals & interrupts

Toggle an output using an explicit software state

Arduino / C: Keep the intended output state in a Boolean variable.

Arduino / C✓ Tested
C++Sequence algorithms

Transform a vector into a separate result

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

C++✓ Tested
Arduino / CText & bounded buffers

Trim surrounding whitespace from an Arduino String

Arduino / C: String.trim modifies the object in place.

Arduino / C✓ Tested
Arduino / CDigital input & output

Turn on the built-in LED

Configure the Uno’s LED pin as an output and drive it high.

LED_BUILTIN✓ Tested
Arduino / CGetting Started

Turn on the LED with a serial command

Arduino / C: Wait for the character 1 in Serial Monitor before turning on the built-in LED.

Arduino / C✓ Tested
Arduino / CGetting Started

Understand setup() and loop()

Arduino / C: See initialization run once and the main loop run repeatedly.

Arduino / C✓ Tested
C#JSON & binary formats

Update a JSON document with mutable nodes

C#: JsonNode permits targeted changes before serializing a document again.

C#✓ Tested