Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
the user can't input multiple words with spaces.

What I have tried:

C++
void createAccount() {
    string createUser, createPass;

    cout << "\t\t\t\tSign up\n";
    cout << "\t\t__________________________________________\n" << endl;
    cout << "\t\t\tEnter Username: ";
   cin>>createUser;
Posted
Updated 24-Apr-24 2:03am
v2

1 solution

It is not clear what you are asking for but you have two choices.
1. Use cin multiple times, once for each item you want.

2. Use std::istream::getline - cppreference.com[^] to read a complete line of text and split it into its separate parts in code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900