C++ Validating Input with a while Loop

preview_player
Показать описание
Demonstrates how to setup a program to loop continuously until the user enters a valid number. Software used in this demo is Xcode on a Mac. Note that the code for Windows is exactly the same.
Рекомендации по теме
Комментарии
Автор

After surfing the web and being dissapointed on every site I went, this video made up for all the frustrating search. Precise and short.This video was exactly what i was looking for. Thank you so much for the help.

Legna
Автор

I know it as been so long since you posted this video (also cool that it was posted on my birthday) but thank you so much. This video helped me and a lot of people in our assignment in class.

ronyamaya
Автор

I know this video is old but OMG THANK YOU SO MUCH!! I knew how to do input validation but I was struggling on how to do input validation if a user were to enter a character.

jc
Автор

You helped me with a problem Ive been having for weeks! Thank you so much!

bigham
Автор

Great vid, i've been struggling all semester in C++ glad to start finding helpful videos like this ! Hopefully i can finish strong

jeremysavala
Автор

I've been stuck trying to figure this out and you helped me so much! thank you very much!!!!

rudyr
Автор

about time I found an answer, thank you!

GerardoMares
Автор

it's useful! gain a lot, thx for explaining!!

ngyehchiann
Автор

thank you so much you helped me with my assignment!!

adibzainulzaky
Автор

What would have been a nice extra for the program is having it also ignore negative numbers.

Good vid though.

trujillo
Автор

tHANK YOU . I owe my program to you muh nigga.

engr.iverson
Автор

Thank you soo much for your explanation :D

DastinDimaz
Автор

This doesn't work when the first character entered is a number.. for example, 'r4' would display "must be a number", but '243tq' would display "don't forget to vote". Does anyone know how to solve this?

updxrxu
Автор

Sorry, but Xcode is only for Mac. You can try DevC++ from Bloodshed, CodeBlocks or Microsoft Visual C++ Express. They are free and available for Windows.

profgustin
Автор

what to type for cin.ignore ('\n') if i only wanted character like y/n to be input ??
hope you read this. i like your explanations

hokx
Автор

Hello your videos are very helpful. I have a question though it has to deal with loops but with functions. the thing is i have to create a program that calculates the grade point average of 3 grades entered. I have to create 4 functions and 1 has to be void type but i really dont know how to loop it. until you decide to exit the program. I dont want you to think im asking you to do the homework for me but if you could explain how to loop functions it would be great. im new to this. :) plz help

Supra
Автор

this does not work for double type number as well... How can check error if the input is a double type???

yangyang
Автор

How would this work if I wanted to do a do while loop asking the user how many Asterix they wanted to print out on the screen?

shelovesthepurpleone
Автор

How about discarding numbers with decimal? ☺😊

ILanoFamily
Автор

did you not check the audio levels before putting the video up? it's so quiet

cboyslim
welcome to shbcf.ru