Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone make a header for the following .cpp? #include using namespace std; int main() { // declaring set for storing string data-type unordered_set stringSet

Can someone make a header for the following .cpp?

#include using namespace std;

int main() { // declaring set for storing string data-type unordered_set stringSet ;

// inserting various string, same string will be stored // once in set

stringSet.insert("code") ; stringSet.insert("in") ; stringSet.insert("c++") ; stringSet.insert("is") ; stringSet.insert("fast") ;

string key = "slow" ;

// find returns end iterator if key is not found, // else it returns iterator to that key

if (stringSet.find(key) == stringSet.end()) cout << key << " not found" << endl << endl ; else cout << "Found " << key << endl << endl ;

key = "c++"; if (stringSet.find(key) == stringSet.end()) cout << key << " not found " ; else cout << "Found " << key << endl ;

// now iterating over whole set and printing its // content cout << " All elements : "; unordered_set :: iterator itr; for (itr = stringSet.begin(); itr != stringSet.end(); itr++) cout << (*itr) << endl; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

W.c.s. , Wd, and W.o.l. for Devon Energy Corp

Answered: 1 week ago

Question

=+beliefs about the brand, product, or service?

Answered: 1 week ago

Question

=+4. Did your message properly reflect the brand's image?

Answered: 1 week ago