@Cheng Yang, Welcome to Microsoft Q&A, based on my test, I find that I always can get fasle
for unsigned_flag
either I input true
or false
. The problem is that the code std::cin >> unsigned_flag;
cannot accept the correct value from console.
I recommend that you could use the following code to get accept value for unsigned_flag
.
std::cin >> std::boolalpha >> unsigned_flag;
Please feel free to let me know if you still meet the problem.
Best Regards,
Jack
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.