federico-busato / Modern-CPP-Programming

Modern C++ Programming Course (C++03/11/14/17/20/23/26)

Home Page:https://federico-busato.github.io/Modern-CPP-Programming/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Misleading comment in example in chapter 4

arnimarj opened this issue · comments

Hi, and thanks for an excellent book.

While reading chapter 4 I believe there's a misleading comment:

	for (int i = 0; auto x : {'A', 'B', 'C'})
		std::cout << i++ << ":" << x << " "; // print: 1:A 2:B 3:C

The incrementor starts at 0, not 1 as the comment indicates

Thanks for reporting it, @arnimarj.