-
bcopy
鎖定
bcopy,函數名。主要作用是將字符串src的前n個字節複製到dest中。
- 中文名
- bcopy
- 原 型
- extern void bcopy
- 用 法
- #include
- 功 能
- 將src的前n個字節複製到dest中
bcopy簡介
原型:extern void bcopy(const void *src, void *dest, int n);
用法:#include <string.h>
説明:bcopy不檢查字符串中的空字節NULL,函數沒有返回值。 在POSIX.1-2001中,bcopy()被標記為不贊成使用,到POSIX.1-2008,bcopy()被移除出了標準,POSIX標準建議用memcpy()、memmove()代替。
bcopy舉例
// bcopy.c #include <syslib.h> #include <string.h> 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); getchar(); return 0; }
- 詞條統計
-
- 瀏覽次數:次
- 編輯次數:8次歷史版本
- 最近更新: JD萤火虫003