Answer:Consider the following code segment:
1. void main()
2. {
3. list <char> l;
4. list <char>:: iterator i;
5. l.push_back('k');
6. l.push_back('i');
7. l.push_back('n');
8. i=l.end();
9. cout<<i;
10.}
The above code will not compile. Identify which line should be changed to fix the error.
Options
a) Line 4
b) Line 3 & Line 4
c) Line 8
d) Line 9
Answer : d) Line 9