FIND YOUR NEXT FEW LINES

Results for “Structures & function interfaces”

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

135 snippets foundClear filters
RustFunctions & data types

Use an associated constructor

Use an associated constructor in a complete Rust program using the standard library.

Rust✓ Tested
C#Collections & data structures

Use case-insensitive dictionary keys

C#: Choose an ordinal comparer when case-insensitive keys represent identifiers.

C#✓ Tested
RustFunctions & data types

Wrap a value in a distinct type

Wrap a value in a distinct type in a complete Rust program using the standard library.

Rust✓ Tested
GoFunctions & types

Write a generic slice helper

Write a generic slice helper using a complete Go program with explicit sample inputs.

Go✓ Tested
PythonFunctions & error handling

Yield values on demand

Python: Use a generator to produce a sequence without storing all intermediate values.

Python✓ Tested
SQLiteJSON data

Check whether text is valid JSON

Reject malformed input before processing it.

json_valid✓ Tested
PowerShellFunctions & control

Choose an action with switch

Map a small command value to a result.

switch✓ Tested
C++Text validation & parsing

Convert ASCII text to lowercase safely

C++: Cast each byte to unsigned char before using the cctype function.

C++✓ Tested
CBinary formats & structured parsing

Convert ASCII text to lowercase safely

C: Cast to unsigned char before calling ctype functions on a possibly signed char.

C✓ Tested
Arduino / CSerial protocols

Convert received ASCII letters to uppercase

Arduino / C: ctype functions should receive an unsigned character value.

Arduino / C✓ Tested
JavaScriptArray restructuring

Create independent rows in a matrix

JavaScript: Use a mapping function to create each row instead of sharing one array with fill.

JavaScript✓ Tested
TypeScriptArray restructuring

Create independent rows in a matrix

TypeScript: Use a mapping function to create each row instead of sharing one array with fill.

TypeScript✓ Tested