Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyC++vector basicsSingle-choice MCQ

Is this loop safe, and why?

std::vector<int> v = {1, 2, 3}; for (int i = 0; i < v.size(); ++i) std::cout << v[i];