Hello I am currently making a program for a database which includes an SSN. The user can input the ssn but I want it in xxx-xx-xxxx and to make sure the user ddoes this have the user input 3 numbers then 2 numbers then 4 numbers in seperate cin statements:
cout<<"Please input the new SSN for the employee: ";
cout<<endl<<"Input the first 3 digits: ";
cin>>SSN[1];
cout<<endl<<"Input the next 2 digits: ";
cin>>SSN[1];
cout<<endl<<"Input the last 4 digits: ";
cin>>SSN[1];
cout<<endl<<"Social Security Number successfully set to "<<SSN[1];
But I need each cin to add to the end of the SSN string. I know that the ios::ate can be done for fie io however I have never seen this used on strings in cin satements before. Is this possible? Thanks