#include <memory.h> #include <string.h> void *memchr(const void *buf, int c, size_t count) buf : バッファへのポインタ c : 探す文字 count : 探す範囲(先頭からの文字数)
#include <stdio.h>
#include <memory.h>
#include <string.h>
int main()
{
char *pos;
char *str = "abcdefghijklmnopqrstuvwxyz";
pos = (char *)memchr(str, 'p', 50);
printf("結果は %s\n", pos);
return 0;
}
結果は pqrstuvwxyz
| 菅沼ホーム | 本文目次 | 演習問題解答例 | 付録目次 | 索引 |