Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2038188
  • 博文数量: 414
  • 博客积分: 10312
  • 博客等级: 上将
  • 技术积分: 4921
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-31 01:49
文章分类

全部博文(414)

文章存档

2011年(1)

2010年(29)

2009年(82)

2008年(301)

2007年(1)

分类: C/C++

2009-01-12 11:08:14

  原型:extern void bcopy(const void *src, void *dest, int n);
  
  用法:#include 
  
  功能:将字符串src的前n个字节复制到dest中
  
  说明:bcopy不检查字符串中的空字节NULL,函数没有返回值。
  
  举例:

      // bcopy.c
      
      #include 
      #include 

      main()
      {
        char *s="Golden Global View";
        char d[20];
        
        clrscr();        // clear screen
        bcopy(s,d,6);
        printf("s: %s\n",s);
        printf("d: %s\n",d);

        getchar();
        clrscr();
        s[13]=0;
        bcopy(s+7,d,11);  // bcopy ignore null in string
        printf("%s\n",s+7);
        for(i=0;i<11;i++)
          putchar(d[i]);

        getchar();
        return 0;
      }
阅读(1745) | 评论(0) | 转发(0) |
0

上一篇:bcmp

下一篇:c语言宏定义的使用

给主人留下些什么吧!~~