當使用memset的時候,初始化的數據如下:134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 134744072 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 回答

千巷貓影
TA貢獻1829條經驗 獲得超7個贊
該問題主要自身對memset的理解不夠透徹。
NAME memset - fill memory with a constant byte SYNOPSIS #include <string.h> void *memset(void *s, int c, size_t n); DESCRIPTION The memset() function fills the first n bytes of the memory area pointed to by s with the constant byte c.
code中alphabet定義的是int而非char,它只是初始化前n byte,而不是4*n byte。
- 1 回答
- 0 關注
- 243 瀏覽
添加回答
舉報
0/150
提交
取消