Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

Mentioned code will not compile. Identify which line should be changed to fix the error.

  Shared By: Alfonsine Miller    Date: Oct 27    Category: C++ Programming    Views: 1037

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

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: