Auto is not working

auto is not working in my ide…

for(auto it=s1.begin();it!=s1.end();it++)
{
cout<<(*it)<<",";
}

@sroy3166 try taking the input header That is bits/stdc++.h . And send me your code

#include #include #include<bits/stdc++.h> using namespace std; int main() { string s0; string s1(“Hello”); string s2 = “Hello World!”; string s3(s2); string s4 = s3; char a[] = {‘a’, ‘b’, ‘c’}; string s5(a); cout<<s1<<endl; cout<<s2<<endl; cout<<s3<<endl; cout<<s4<<endl; cout<<s5<<endl; if(s0.empty()) { cout<<“s0 is empty!”<<endl; } // Append s0.append(“I love C++”); cout<<s0<<endl; s0 += " also python."; cout<<s0<<endl; // Remove cout<<s0.length()<<endl; s0.clear(); cout<<s0.length()<<endl; // Compare two string s0 = “Apple”; s1 = “Mango”; cout<<s0.compare(s1)<<endl; cout<<s1.compare(s0)<<endl; cout<<s0.compare(s0)<<endl; // Use overloaded operators cout<<(s0<s1)<<endl; cout<<(s0>s1)<<endl; if(s0<s1) { cout<<“Mango is lexicographically grater than apple”<<endl; } // Find function string s = “I love to eat apple”; int indx = s.find(“apple”); cout<<indx<<endl; // Remove a word from the string string word = “apple”; int len = word.length(); cout<<s<<endl; s.erase(indx,len); cout<<s<<endl; // Itrate over the charecter in a string for(int i=0;i<s1.length();i++) { cout<<s1[i]<<":"; } cout<<endl; // Itrate // string::iterator it; for(auto it=s1.begin();it!=s1.end();it++) { cout<<(*it)<<","; } cout<<endl; string::iterator c; // // for each loop for(c:s1) { cout<<c<<"."; } cout<<endl; // return 0; }

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.