I’m using this code to check that a student number being entered is the correct number of digits. Is there a function like .length() that will work for the variable type double? Thanks!
do {
cout << "Student's number: (Numeric only)";
cin >> studentNumber;
cin.ignore();
}
while (studentNumber.length() != 6);
Read it as text, validate it, then parse it: