Check out example codes for "how to make a login c++". It will help you in understanding the concepts better.

Code Example 1

// a simple login for c++ using while loops and io (input output)
#include <iostream>
#include <string>

using namespace std;

int main() {
  cout << "please enter password";
  string pass = "0";                  // making a string for user input
  cin >> pass;                        // could be replaced with getline(cin, pass);
  while (pass = "1234") {             // while loop for when password is wrong
    cout << "incorrect, try again";
    cin >> pass;                      // could be replaced with getline(cin, pass);
  }
  cout << "correct password";         // runs when the while loop is no longer happening
}

Learn ReactJs, React Native from akashmittal.com