FIND YOUR NEXT FEW LINES

Results for “C++”

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

3000 snippets foundClear filters
Bash ScriptsArguments & decisions

Parse a small set of long options

Bash Scripts: Use a loop and case statement to consume a value-bearing long option.

Bash Scripts✓ Tested
C#Types & reliable control flow

Parse an enum name without throwing

C#: Combine TryParse and IsDefined when only named declared values should be accepted.

C#✓ Tested
JavaPrecise numeric calculations

Parse an integer in another base

Java: Supply an explicit radix to Integer.parseInt.

Java✓ Tested
CNumbers & memory

Parse an integer with validation

Validate range and trailing characters when parsing a C integer with strtol.

C✓ Tested
PowerShellDates & numeric validation

Parse an integer without throwing on invalid input

PowerShell: TryParse reports conversion success separately from its output value.

PowerShell✓ Tested
JavaScriptObjects & JSON

Parse JSON text

Read a JavaScript object from JSON text.

JavaScript✓ Tested
Bash ScriptsInput streams & redirection

Pass a variable to standard input

Bash Scripts: A here-string supplies the expanded value followed by a newline.

Bash Scripts✓ Tested
C++Tasks & synchronization

Pass an argument into a worker thread

C++: Thread arguments are copied by default; std::ref explicitly passes a reference.

C++✓ Tested
Docker / ComposeContainer commands

Pass an environment variable

Supply configuration without changing an image.

environment✓ Tested
ReactGetting Started

Pass data through props

Pass data through props with a small React component and explicit browser behavior.

React✓ Tested
Arduino / CDigital signals & interrupts

Play a fixed digital output pattern

Arduino / C: A pattern table separates the output sequence from its timing.

Arduino / C✓ Tested
Docker / ComposeDockerfile patterns

Prepare an owned directory before dropping root

Docker / Compose: Create and chown the writable application path before USER.

Docker / Compose✓ Tested