Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #107.79K
Ranked #4K
~148 People Reached
Favorite Forums
Favorite Tags
c++ x 1

1 Posted Topic

Member Avatar for grisha83

[code=cplusplus] #include <iostream> #include <vector> #include <algorithm> #include <iomanip> #include <string> using namespace std; bool compare(string s1,string s2) { if(strcmp(s1.c_str(),s2.c_str())>0) return true; else return false; } int main() { string a[]={"abc","dafa","eeee","what"}; vector<string> names(a,a+4); // increasing alphabetical sequence sort(names.begin(),names.end()); for(vector<string>::const_iterator itr=names.begin();itr<names.end();itr++) { cout<<*itr<<" \t"; } cout<<endl; // decreasing alphabetical sequence sort(names.begin(),names.end(),compare); …

Member Avatar for grisha83
0
148

The End.