The catalog now contains the three completed records from the first stage. This stage adds lookup without changing those records. Searching by identifier avoids depending on a book's current position in the vector.
findBook receives std::vector<Book>&: a reference to the actual catalog. It returns Book*, a non-owning pointer to a matching element, or nullptr when there is no match. A mutable pointer is intentional because the following stage will update loan state through it. The lookup itself should not change any record.
Use a range loop with Book& book. The reference matters: returning &book from a by-value loop would point at a temporary local copy whose lifetime ends. With a reference loop, &book points to the vector's real element. Return immediately when book.id matches the requested identifier. If the loop finishes without a match, return null.
The vector owns the record; the returned pointer only borrows it. Do not delete this pointer or put it into a unique_ptr: the element is not a separately allocated object for the caller to release. The catalog must remain alive while the pointer is used. Growing a vector can also invalidate pointers to its elements, so this project finishes construction first and never resizes the catalog while using these views.
A second helper, labelFor, converts an optional read-only book pointer into display text. Check for null before using ->title. The supplied Console probes ask for an existing id, an absent id, a direct book label, and a missing label. The found-id output checks for null before reading found->id. That is why the unfinished search can safely print -1. The label probe uses &catalog[0] directly, so you can check labelFor even before lookup is complete. The earlier record output remains in place as a continuity check.
Edit main.cpp; the supplied Console probes already call your code.
findBook with a reference loop, returning the address of the matching record or null after an unsuccessful search. Expect Found id: 102 and Missing id: true.labelFor: return "missing" for null, otherwise the pointed-to title. Expect Label: River Paths and Missing label: missing.Use Run to inspect the Console, then Submit to check your work.