Results for “read lines”
Small, practical examples. Search by task or narrow things down below.
Measure a short text value
C++: Read the length of an ASCII string. Non-ASCII text may use multiple code units or bytes depending on the language.
C++✓ Tested
Measure a short text value
C: Read the length of an ASCII string. Non-ASCII text may use multiple code units or bytes depending on the language.
C✓ Tested
Merge object settings
Use object spread to apply JavaScript overrides to defaults.
JavaScript✓ Tested
Merge two sorted sequences
C++: Both inputs must use the same ordering before merge is called.
C++✓ Tested
Mount a local input directory with long syntax
Docker / Compose: Long mount syntax makes the bind type and read-only intent explicit.
Docker / Compose✓ Tested
Name a value that stays fixed
C++: Use a constant declaration or the language’s constant naming convention for a fixed limit.
C++✓ Tested
Normalize a path without touching the filesystem
C++: lexically_normal removes redundant dot components using path syntax alone.
C++✓ Tested
Observe an exception from an asynchronous task
C++: Calling get rethrows an exception captured by the future.
C++✓ Tested
Observe shared ownership without extending its lifetime
C++: A weak_ptr can be locked while an owner exists and becomes expired after the last owner is released.
C++✓ Tested
Own one dynamically allocated value with unique_ptr
C++: make_unique allocates a value whose lifetime is tied to its owning smart pointer.
C++✓ Tested
Parse a complete integer without exceptions
C++: from_chars reports both an error code and the first unconsumed character.
C++✓ Tested
Parse a hexadecimal integer with from_chars
C++: An explicit radix controls digit interpretation without a locale dependency.
C++✓ Tested