blob: 0788e51b35c3c166b0e4a3aca8932818c38a4fce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
/*
*
* 4.18
*
*
*/
int main () {
/*
auto pbeg = v.begin();
while (pbeg != v.end() && *beg >= 0)
cout << *pbeg++ << endl;
*/
// It would increment pbeg by 1 and then dereference and print.
// This would mean that the first element in the vector is not printed
// This would also mean dereferencing whatever is at v.end() which is not a good idea.
return 0;
}
|