how do you check if cin fails?

how do i know if cin fails when getting the input? do i use an if statement or something to see the value?
Was this page helpful?