Hey, I'm picking up C++. I have a question about the evaluation of the following:
It's my understanding that this evaluates to true as long as the input is not end-of-file or a non int. But what is it that is returned exactly? Tried this:Code:int var; if(std::cin >> var) //do something
I have found out that it's a void* but, it's not an object (hence the cast), well what is it then?Code:while( (void *ret = (std::cin >> var)) ){ printf("%d, %p, %d\n", var, ret, *((int*)(ret))); }