本文共 410 字,大约阅读时间需要 1 分钟。
#includeusing namespace std;int main(){ char str1[100] = "ab\0cdddddddddd"; cout << str1 << endl; FILE *fa = fopen("a.txt", "wb"); fwrite(str1, sizeof(str1), 1, fa); fclose(fa); char str2[100] = "ab"; cout << str2 << endl; FILE *fb = fopen("b.txt", "wb"); fwrite(str2, sizeof(str2), 1, fb); fclose(fb); if(0 == strcmp(str1, str2)) { cout << "yes" << endl; } else { cout << "no" << endl; } return 0;}
转载地址:http://larvi.baihongyu.com/