What is a c++ map?



What is a c++ map?..

Answer / Kumari Geetanjali

A C++ map (or std::map) is a data structure that stores key-value pairs, where the keys are sorted in a specific order. It provides fast lookup and insertion/deletion operations, but access to values using the key has logarithmic complexity.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

how to find the maximum of 10 numbers ?

5 Answers  


Should the member functions which are made public in the base class be hidden?

1 Answers  


What is the difference between #import and #include in c++?

1 Answers  


What is the difference between inline functions and macros?

5 Answers  


Explain one-definition rule (odr).

1 Answers  


What is an object in c++?

2 Answers  


what is data Abstraction? and give example

147 Answers   Aaditya Info Solutions, American Express, CMS, College School Exams Tests, Data Entry Operator, First Advantage, Google, HCL, IBM, Infosys, Microsoft, Mind Links, NIIT, Oracle, Pact, QBit Systems, TCS, WAYA, Wipro,


Can I have a reference as a data member of a class? If yes, then how do I initialise it?

1 Answers  


What is static class data?

1 Answers  


What are associate containers?

1 Answers  


Q1 On the screen how do you write the following words? she sells seashells by the seashore (a) all in one line (b) in three lines Q2 Write a program that asks interactively the user’s name and age and responds with Hello name, next year you will be next_age. where next_age is age + 1 Q3 For the different values of n, what is the output? printf(“%x %c %o %d”,n,n,n,n); (a) n = 67 (b) n = 20 (c) n = 128 (d) n = 255 (e) n = 100 Q4 What will be the output of the following program? int main() { char a,b,c; scanf(“%c %c %c”,&a,&b,&c); printf(“a=%c b=%c c=%c”,a,b,c); return 0; } [Note: The user input is:ABC DEF GHI]

1 Answers  


class X { public: int x; static void f(int z); }; void X::f(int y) {x=y;} What is the error in the sample code above? a) The class X does not have any protected members. b) The static member function f() accesses the non-static z. c) The static member function f() accesses the non-static x. d) The member function f() must return a value. e) The class X does not have any private members.

2 Answers   Quark,


Categories