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
int main() { // declaring set for storing string data-type unordered_set
// 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started