FIND YOUR NEXT FEW LINES

Results for “k”

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

1871 snippets foundClear filters
RustFiles & paths

Copy a file and inspect the copied byte count

Copy a file and inspect the copied byte count in a complete Rust program using the standard library.

Rust✓ Tested
Arduino / CEEPROM & program memory

Copy a flash string into a bounded RAM buffer

Arduino / C: strncpy_P reads from program memory into ordinary RAM.

Arduino / C✓ Tested
Arduino / CDigital signals & interrupts

Copy a multibyte interrupt-owned counter atomically

Arduino / C: ATOMIC_RESTORESTATE restores the interrupt state after reading a shared value.

Arduino / C✓ Tested
GoSlices & collections

Copy a slice without sharing storage

Copy a slice without sharing storage using a complete Go program with explicit sample inputs.

Go✓ Tested
GoFiles & paths

Copy a stream and count its bytes

Copy a stream and count its bytes using a complete Go program with explicit sample inputs.

Go✓ Tested
Arduino / CText & bounded buffers

Copy a string with a guaranteed terminator

Arduino / C: Reserve one character for the terminator when copying a bounded string.

Arduino / C✓ Tested
Bash ScriptsArray operations

Copy an array independently

Bash Scripts: A new array assignment copies element values rather than creating a shared reference.

Bash Scripts✓ Tested
GoMaps & sets

Copy entries into another map

Copy entries into another map using a complete Go program with explicit sample inputs.

Go✓ Tested
CStrings

Copy text into a fixed buffer

Use snprintf and check for truncation when copying a C string.

C✓ Tested
Arduino / CDigital signals & interrupts

Count a button’s falling edge in the main loop

Arduino / C: Compare each reading with the previous state to detect transitions.

Arduino / C✓ Tested
Arduino / CDigital input & output

Count a falling edge with an interrupt

Increment a counter when an external input changes.

attachInterrupt✓ Tested
Arduino / CDigital signals & interrupts

Count a rising edge with an interrupt

Arduino / C: RISING triggers when the input changes from low to high.

Arduino / C✓ Tested