Results for “save file”
Small, practical examples. Search by task or narrow things down below.
Parse a bounded simple record with sscanf
C: A width limit protects the destination buffer and the consumed count detects trailing junk.
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 date with an explicit input pattern
Java: Use DateTimeFormatter for a non-ISO date representation.
Java✓ Tested
Parse a hexadecimal integer with from_chars
C++: An explicit radix controls digit interpretation without a locale dependency.
C++✓ Tested
Parse a short option with getopts
Read a named option and handle invalid flags explicitly.
getopts✓ Tested
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
Parse a typed command-line option
Python: Use argparse to validate and convert an integer option.
Python✓ Tested
Parse a UUID and inspect its version
Java: Use UUID.fromString for a standard UUID value.
Java✓ Tested
Parse an integer in another base
Java: Supply an explicit radix to Integer.parseInt.
Java✓ Tested
Parse an integer safely
Handle invalid Java integer input with NumberFormatException.
Java✓ Tested
Parse an integer with validation
Validate range and trailing characters when parsing a C integer with strtol.
C✓ Tested
Parse an ISO calendar date
Python: Use date.fromisoformat and inspect the calendar components.
Python✓ Tested