vendredi 7 avril 2017

What does this snippet of code do? [duplicate]

This question already has an answer here:

I'm reading through the C++ Primer and they're explaining how if statements work, but I'm not sure I understand what the expression is meant to do.

if (std::cin >> value) {
    do etc
{

What is the if statement checking? I don't quite get how std::cin >> value can be interpreted as a boolean. Is it just checking to see if there is something for the input stream to take in?

Aucun commentaire:

Enregistrer un commentaire