Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- #include <conio.h>
- #include <stdio.h>
- #include <regex>
- string Sortstr (str[mlength]);
- sort(Sortstr.begin(), Sortstr.end());
- int mlength = 100;
- int main()
- {
- char str[mlength];
- int length;
- cout << "Please enter a c-string: ";
- cin.getline(str,mlength,'n');
- regex pass1("^[a-zA-Z]+");
- while(!regex_match(str,pass1))
- {
- cout<<"Error"<<endl;
- cout << "Please enter a c-string: ";
- cin.getline(str,mlength,'n');
- }
- string Sortstr (str[mlength]);
- sort(Sortstr.begin(), Sortstr.end());
- }
Add Comment
Please, Sign In to add comment