I am attempting to evaluate user input to see if it conflicts with a single string and not a array of strings. The user cannot enter "Admin" as their login name, and if they do it resets the prompt for a new entry; however, if the user does not enter "Admin" and they press "Y" to confirm his or her name, the string they enter (PendingChar_Name) is not assigned to the CheckedChar_Name, and therefore the program cannot display the CheckedChar_Name as the user's name.
Obviously I cannot evaluate and assign strings this way, otherwise it would work - or, the flow of control in my program is broken. What am I missing in evaluating and assigning PendingChar_Name and CheckedChar_Name?
Your problem is here: PendingChar_Name = CheckedChar_Name; swap the operands
Also notice that this line: }while(cDecision == 'Y' || cDecision == 'y'); will make the loop restarting if the user says 'y'
Interesting. I cant believe I didn't consider which way the operands flowed in this statement. Thank you for enlightening my oversight.
It is clear I am giving the user only one option with the code:
}while(cDecision == 'Y' || cDecision == 'y');.
The user wont be able to reset their name by typing "N/n" for "No/no" to re enter the do/while loop. Would you suggest using an if/else if loop to allow both Y' and N' to determine the course of the program?