Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
1 - 您可以使用字符串的 c_str() 方法来访问底层 C 字符串:
if(strcmp(PQgetvalue(res,row,col),date().c_str()) != 0)
2 - 更好的是,如果你想去“完整的 C++”,将输出转换PQgetvalue为字符串,并使用比较运算符:
PQgetvalue
if(string(PQgetvalue(res,row,col)) == date())