3
我在Xcode 4中創建了一個非常基本的C控制檯應用程序,並且在編譯時遇到了一個警告:Implicit declaration of memcmp is invalid in c99
。memcmp的隱式聲明在c99中無效
我該功能的使用是你所期望的:
if(memcmp(buf, block, 0x14) != 0)
{
fclose(fh);
printf("invalid file: %s\n", argv[argc-1]);
return 1;
}
如何使用功能錯誤的,我怎麼能去修復它?
它實際上在C89/C90中也是未定義的行爲。您應該*總是*'#include'適用於您使用的任何庫函數的適當頭文件。 –