Safer Integer Input in C with `fgets()` and `strtol()`
Build a reliable line-based integer parser that rejects partial conversions, overflow, and input left behind in the stream.
FIELD NOTES
Notes on things I’m exploring, building, and learning. Writing helps me work through ideas and share what I discover.
All posts 17
Build a reliable line-based integer parser that rejects partial conversions, overflow, and input left behind in the stream.
Use the ferry project's RouteList to see how C pointers, realloc, ownership, and structure swaps form a growable array.
Trace a real Battleship event through a Map-backed pub-sub bus from attack logic to board rendering.
Follow one stock issue as a C program consumes SQLite inventory batches in insertion order and records the cost allocation.
Follow a C inventory program from compiling SQLite into the executable to opening, querying, and safely closing its local database file.
Compare inorder predecessor and successor replacement strategies while following the Binary-Search-Tree repository's successor-based deletion.
A repository-backed walkthrough of leaf, one-child, and two-child BST deletion with recursive subtree-root updates.
Explain the Binary-Search-Tree repository’s one-pass balance check and its -1 sentinel for failed subtrees.
Follow the Binary-Search-Tree repository’s midpoint construction from sorted unique values to a balanced initial tree.
A repository-backed introduction to binary-tree shape, the BST ordering invariant, search paths, and traversal orders.
Predict Node.js execution order by separating synchronous stack work, next ticks, microtasks, timers, polling, and immediates.
Follow merge sort from its recursive splits to the comparisons that rebuild one sorted array.
A repository-backed explanation of hashing, separate chaining, resizing, and the limits of constant-time map operations.
A repository-backed walkthrough of nodes, traversal, head and tail invariants, insertion, removal, and reference updates.
A call-site mental model for understanding how regular and arrow functions receive their value of this.
A practical mental model for prototype links, inherited properties, constructor prototypes, and JavaScript classes.
A practical guide to describing how algorithm costs grow without confusing asymptotic bounds with measured runtime.