一个strlen的问题
#include <iostream> #include <cstring> using namespace std; int main() { if(-1<=strlen("Hello world")) { cout<<"-1<=strlen(\"Hello world\")"<<endl; } int nLen=strlen("Hello world"); if(-1<=nLen) { cout<<"-1<="<<nLen<<endl; } return 0; }
结果:
-1<=11