機能 |
指定の値を指定サイズ分だけコピーする。 |
||||||
---|---|---|---|---|---|---|---|
定義 |
#include <string.h> void * memset ( void * s, int c, size_t n ); |
||||||
引数 |
|
||||||
戻り値 |
引数sを返す。 |
||||||
実装例 |
#include <string.h> #include <stdio.h> int main(void) { char str[5]; memset(str, 'a', 3); str[3] = '\0'; printf("%s\n", str); return 0; } |
||||||
実行結果 |
aaa |
memset()