Demystifying cout and cin in C++