Skip to main content

Posts

Showing posts with the label Unordered Map

C++ STL (Containers) Tutorial For Beginners Learn STL Hacks Part -2

In continuation of my STL tutorial series, I'll be introducing to some more STL containers in this post. The containers I shall be covering include: CONTAINERS String Streams Map Multiset Priority Queue String Streams Stringstream is the processing of input/output strings. The stringstream class in C++ allows a string object to be treated as a stream. It is used to operate on strings. By treating the strings as streams we can perform extraction and insertion operation from/to string just like cin and cout streams. C++ provides two interesting objects for it: ‘istringstream’ (input stringstream ) and ‘ostringstream’ (output stringstream). Both of these are declared in #include< stream >. Object istringstream allows you to read from a string like you do from standard input. The ostringstream object is used to do formatting output. Insertion And Extraction Operations Using stringstream Insertion (i) Using Insertion Operator (<<) Data i...