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;
}
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 |
What does stl mean in slang?
Is string part of stl?
What are the symptoms of stl?
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?"
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.
What is the disadvantage of templates ?
Who created stl?
what is the difference between thread and process
How Find, Replace and Go To commands ca be used to substitute one character string for another? Explain with the heIp of an example.
What is Template Specialization?
c# support late binding or early binding.
write a program that input four digit no and finds it is palindrome or not