FIND YOUR NEXT FEW LINES

Results for “struct”

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

152 snippets foundClear filters
GoJSON & encoding

Decode JSON into a typed struct

Decode JSON into a typed struct using a complete Go program with explicit sample inputs.

Go✓ Tested
RustGetting Started

Destructure a tuple

Destructure a tuple in a complete Rust program using the standard library.

Rust✓ Tested
ReactComponents & props

Destructure nested data in a component

Destructure nested data in a component with a small React component and explicit browser behavior.

React✓ Tested
GoFunctions & types

Embed a struct for shared fields

Embed a struct for shared fields using a complete Go program with explicit sample inputs.

Go✓ Tested
GoJSON & encoding

Encode a struct with JSON field names

Encode a struct with JSON field names using a complete Go program with explicit sample inputs.

Go✓ Tested
GoGetting Started

Group fields in a struct

Group fields in a struct using a complete Go program with explicit sample inputs.

Go✓ Tested
Arduino / CArrays & embedded state

Group related readings in a struct

Arduino / C: A struct keeps a sample’s fields together without dynamic allocation.

Arduino / C✓ Tested
CStructures & function interfaces

Group related values in nested structures

C: Nested members model a record that owns another simple record.

C✓ Tested
RustFunctions & data types

Implement a method on a struct

Implement a method on a struct in a complete Rust program using the standard library.

Rust✓ Tested
CStructures & function interfaces

Initialize structure fields by name

C: Designated initializers make field assignments independent of their declaration order.

C✓ Tested
AngularPipes & formatting

Inspect structured data with JsonPipe

Inspect structured data with JsonPipe with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
CStructures & function interfaces

Keep caller data unchanged by passing a structure by value

C: A value parameter is a copy of the original structure.

C✓ Tested