创建一个套接字程序,我在这里收到一些警告。不确定问题是什么:
if (recv, clientWantsFile, MAX_PATH, 0) {
ifstream file (clientWantsFile);
if (file.is_open()) {
send(Sub, "yes", MAX_PATH, 0);
} else {
send(Sub, "no", MAX_PATH, 0);
}
// Gets the size of the file requested
fileSize = file.tellg();
}
警告:
warning: left operand of comma operator is a reference, not call, to function 'recv' [-Waddress]
warning: left operand of comma operator has no effect [-Wunused-value]
warning: right operand of comma operator has no effect [-Wunused-value]
有什么可能出错的线索?