Logo 
Search:

C++ Programming FAQ

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

map k = map_test; Which of statement(s) does illustrate the above code correctly? - Select

  Shared By: Ellie Brown    Date: Nov 22    Category: C++ Programming    Views: 881

Answer:

If map_test is a map,
map<x,y> k = map_test;
Which of the following statement(s) does illustrate the above code correctly?

I. It will create a new map k whose elements are logical copies of the elements of map_test.
II. It is equivalent to: map<x,y>map_test(k);
III. It will create a new map map_test whose elements are logical copies of the elements of k.
IV. It is equivalent to: map<x,y>k(map_test);

Options

a) I only
b) IV only
c) Both II and III
d) Both I and IV

Answer : d) Both I and IV

Share: 
 



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


Tagged: