Stdle #90 · classes · 2026-09-04
What does this C++ snippet output?
A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
#include <iostream>#include <vector>void push(std::vector<int>& v) { v.push_back(9); }int main() { std::vector<int> data = {1, 2}; push(data); // by ref: grows caller's vector std::cout << data.size() << "\n"; return 0;}Classes