FIND YOUR NEXT FEW LINES

Results for “struct”

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

152 snippets foundClear filters
CDynamic memory & ownership

Allocate and initialize a structure

C: Use a compound literal assignment to initialize all ordinary structure fields.

C✓ Tested
CSSInteraction selectors

Alternate row backgrounds with a structural selector

CSS: Nth-child counts sibling positions starting at one.

CSS✓ Tested
jQueryGetting Started

Append a safely constructed list item

jQuery: Learn how to append a safely constructed list item in a complete browser example.

jQuery✓ Tested
GoFunctions & types

Attach behavior to a struct

Attach behavior to a struct using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaScriptUTC date operations

Construct a date from Unix seconds

JavaScript: Multiply seconds by 1000 before creating a Date.

JavaScript✓ Tested
TypeScriptUTC date operations

Construct a date from Unix seconds

TypeScript: Multiply seconds by 1000 before creating a Date.

TypeScript✓ Tested
RustGetting Started

Construct a named-field struct

Construct a named-field struct in a complete Rust program using the standard library.

Rust✓ Tested
PowerShellHashtables & object records

Construct a record with named properties

PowerShell: PSCustomObject gives downstream pipeline commands meaningful property names.

PowerShell✓ Tested
RustFunctions & data types

Construct a struct with default values

Construct a struct with default values in a complete Rust program using the standard library.

Rust✓ Tested
RustNumbers & durations

Construct an instant relative to the Unix epoch

Construct an instant relative to the Unix epoch in a complete Rust program using the standard library.

Rust✓ Tested
JavaScriptObject behavior & collections

Copy nested structured data independently

JavaScript: structuredClone creates an independent copy of supported structured values.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Copy nested structured data independently

TypeScript: structuredClone creates an independent copy of supported structured values.

TypeScript✓ Tested