Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- using namespace std;
- class string02{
- private:
- string fullName;
- public:
- void input(){
- cout<< "Enter the Full Name : ";
- getline(cin,fullName);
- }
- void processOutput(){
- string fname=fullName.substr(fullName.rfind(" ")+1);
- string lname=fullName.substr(0,fullName.rfind(" "));
- cout<<"convert name : "<<fname<<", "<<lname<<endl;
- }
- };
- int main(){
- string02 obj;
- obj.input();
- obj.processOutput();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment