THIS WONT WORK it says terminate called after throwing an instance out of range
char ans;
do{ cout<<"Whats your full name\n";
string fullname;
getline(cin,fullname);
char first=fullname[0];
int index=fullname.find(' ');
char last=fullname.at(index+1);
cout<<first<<" "<<last<<endl;
cout<<"wanna do it again? enter y\n";
cin>>ans;
}while(ans=='y');