OR operator doesn't evaluate both statements, only 1
问题 std::ifstream file_1(argv[1]); std::ifstream file_2(argv[2]); ... std::string dummy_1; std::string dummy_2; ... while(std::getline(file_1, dummy_1) || std::getline(file_2, dummy_2)) // the problem { ... } The condition behaves like the OR operator is evaluating the option on the right only if the file on the left reach the end (returning a FALSE) and it doesn't evaluate them at the same time. I know that the evaluation of a statement has nothing to do with the operator itself or with its own