跳至內容

C 程式設計/string.h/memset

來自華夏公益教科書,開放的書籍,開放的世界

C 語言函式,包含在 C 標準庫 (stdlib) 中,用於設定記憶體中的給定位元組。

#include <string.h>
void *memset(void *s, int c, size_t n);

memset()c 複製到 s 指向的物件的前 n 個位元組中。

返回值

[編輯 | 編輯原始碼]

該函式返回指標 s。當發生錯誤時,沒有定義的返回值。

原始碼

[編輯 | 編輯原始碼]
華夏公益教科書