Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!