Is there any error below, its a code to delete all entires
from a map
#include <map>
#include iostream.h
int main()
{
int i =0;
map <int, char> TestMap;
while(i<3)
{
TesMap.insert(TestMap::value_type(i,Test));
i++;
}
typedef map<int, char> :: iterator mapIter =TestMap.begin();
if(mapIter!=TestMap.end())
{
TestMap.erase(mapItrer);
++mapIter;
}
return 0;
}





Is there any error below, its a code to delete all entires from a map #include <map> #incl..

Answer / Mohd Ullfat Ullha Khan

There are several issues with the provided code. Firstly, the 'map' library requires angle brackets (< >) instead of square brackets ([ ]) for templates. Secondly, 'iostream.h' is an input/output stream library and is not needed for map manipulation. Lastly, the 'int main()' function should be indented correctly to ensure the correct flow of the code.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More STL Interview Questions

What does stl mean in slang?

1 Answers  


Is string part of stl?

1 Answers  


What are the symptoms of stl?

1 Answers  


Assume I have a linked list contains all of the alphabets from "A" to "Z?" I want to find the letter "Q" in the list, how does you perform the search to find the "Q?"

2 Answers  


write a c++ to define a class box with length,breadth and height as data member and input value(),printvalue() and volume() as member functions.

3 Answers  


What is the disadvantage of templates ?

2 Answers   NSN, Symphony,


Who created stl?

1 Answers  


what is the difference between thread and process

1 Answers   Infosys,


How Find, Replace and Go To commands ca be used to substitute one character string for another? Explain with the heIp of an example.

1 Answers  


What is Template Specialization?

1 Answers   Lucent,


c# support late binding or early binding.

6 Answers  


write a program that input four digit no and finds it is palindrome or not

2 Answers  


Categories