How to Input Validate an Integer (int) in C++ - using a while loop, cin.clear(), and cin.ignore()

preview_player
Показать описание

__GITHUB REPO__:

__ABOUT THIS CHANNEL__:
It is my goal to help you succeed in your journey in learning to code. That’s why I’m here—to serve you. I enjoy teaching and spreading knowledge of the things that I am passionate about. I am a husband and a father, far from perfect, and striving to be better every day. Thank you for taking interest in what I do!

__FIND ME__:

__SUPPORT THIS CHANNEL__:
||
RECOMMENDED BOOKS:

EQUIPMENT USED:

RECENTLY READ BOOKS:
||
__
Рекомендации по теме
Комментарии
Автор

I can't thank you enough, a 90-second solution for something I was searching for HOURS for my homework. Really clear too

martharendon
Автор

Looking for several days for a solution to my infinite loop, your solution works wonderfully!

efrasomething
Автор

Quick Explantion and straight to the Point without to much blah.

Thank you so much, my man!

PersecutedPursuer
Автор

dude you just literally saved my life right now. Thank you.

TheBoogeyman
Автор

Thank you so much this short and simple video helped me a lot

szmedia
Автор

Thank you so much, the best video i founded about integers validation, great job man!

AleArguedas
Автор

can we use cin.fail()? what's the different?

ELghaz
Автор

Amazing, best short and simple video on youtube. Thanks buddy

anshulgorewar
Автор

God bless you sir, thank you for the help!

timmystfl
Автор

OMG TYSM IVE BEEN SEARCHING THIS FOR OURS i finally found it thanks to that im going to subscribe looking forward to learn more from your channel

frostbreaker
Автор

thank you it help me solve the big part of my project appreciated

saadsalman
Автор

Ty my dude, this came in handy for my homework

TheCanadajezus
Автор

Thank you, this video saves people time even today)

osaka.bez_hobotov
Автор

i wish if all youtubers like you.. thanks a lot.

youngisaac
Автор

Ok, but if I put for example 4e I don't get error and 4 is saved. Is there any idea to get error in this case?

patryksuperspital
Автор

Thanks so much! Do you have a fix for leading numbers and then letters, ex: 12Austin, as this for me still crashes my program..

austin
Автор

Amazing video bro! But in my situation.. I need to validate the user input to be between a range of 0 to 6000. How would you go about this ?

pdx_falcon
Автор

Is it possible to do this but check the user input is not an integer? I have tried cant seem to figure it out.

tobyconoley
Автор

if required input 3009 and if user enters 30aw how to validate this?? i/p data type is int

GujjuRakshit
Автор

Hello. Thank you for this tutorial. But when i try to input 12* it doesn't work. It's supposed to be an error, but the program accept it. Can you please help me to fix that ?

aissata
visit shbcf.ru