Translations of this page?:

memchr

语法:

    #include <cstring>
    void *memchr( const void *buffer, int ch, size_t count );

memchr() 在由buffer指出的数字前count个字符中查找第一次出现的ch。返回值指向ch第一次出现的位置,如果ch没有发现返回NULL。例如:

     char names[] = "Alan Bob Chris X Dave";
     if( memchr(names,'X',strlen(names)) == NULL )
       printf( "Didn't find an X\n" );
     else
       printf( "Found an X\n" );

相关主题: memcmp, memcpy, strstr

 
• • • SitemapRecent changesRSScc