zoukankan      html  css  js  c++  java
  • memccpy()函数

      原型:extern void *memccpy(void *dest, void *src, unsigned char c, unsigned int count);
      参数:
      dest Pointer to the destination.
      src Pointer to the source.
      c Last character to copy.
      count Number of characters.
      用法:#include <string.h>
      功能:由src所指内存区域复制不多于count个字节到dest所指内存区域,如果遇到字符c则停止复制。
      返回值:如果c没有被复制,则返回NULL,否则,返回一个指向紧接着dest区域后的字符的指针。
      举例:
      // memccpy.c
      #include <syslib.h>
      #include <string.h>
      main()
      {
      char *s="Golden Global View";
      char d[20],*p;
      clrscr();
      p=memccpy(d,s,'x',strlen(s));
      if(p)
      {
      *p='\0'; // MUST Do This
      printf("Char found: %s.\n",d);
      }
      else
      printf("Char not found.\n");
      getchar();
      return 0;
      }

     

  • 相关阅读:
    会议总结
    排球比赛积分规则
    我的计算机历程和认识
    排球积分程序
    《如何成为一个高手》观后感
    十八周总结
    十六周总结(流程)
    排球计分程序
    十四周学习总结
    十三周学习总结
  • 原文地址:https://www.cnblogs.com/eagleking0318/p/6521303.html
Copyright © 2011-2022 走看看