題:
[C語言]memcpy和memset的用法?{急-15點}
Rin
2005-11-28 05:22:36 UTC
請舉例並說明每個部份代表的意義...謝謝^^
(不然可以用下面這個來說明)

memcpy( board2 , board1 , sizeof( int )*64 );
memset( board , 0 , sizeof( int )* 64 );
一 回答:
Mark
2005-11-28 09:17:24 UTC
void *memcpy( void *dest, const void *src, size_t count );

從src copy count bytes到dest

example : 從board1的位址 copy 64*sizeof(int) bytes到board2的位址



void *memset( void *dest, int c, size_t count );

從dest開始的連續count bytes, 每個byte的值都設為c

example : 從board1的位址開始連續64*sizeof(int) bytes都設為0


此內容最初發佈在 Y! Answers 上,這是一個於 2021 年關閉的問答網站
Loading...