一步到位,不看流程
memset第一個參數是void * 類型,我用的是char類型
1.使用強制轉換
2.需要包含include <string.h>
警告
使用memset後警告 implicit declaration of function ‘memset’ [-Wimplicit-function-declaration
原因
memset()函數原型是extern void *memset(void *buffer, int c, int count)
第一個參數是void * 類型 我用的是char類型
過程
使用強制轉換後依舊警告
解決
需要include <string.h>