bzero

置位元組字元串前n個位元組為零且包括‘\0’。

基本介紹

  • 中文名:bzero
  • 用法:#include <string.h>
  • 原型:extern void bzero
  • 參數說明: n 要置零的數據位元組個數
簡介
原型:extern void bzero(void *s, int n);
參數說明:s 要置零的數據的起始地址; n 要置零的數據位元組個數。
用法:#include <string.h>
功能:置位元組字元串s的前n個位元組為零且包括‘\0’。
說明:bzero無返回值,並且使用string.h頭檔案,string.h曾經是posix標準的一部分,但是在POSIX.1-2001標準裡面,這些函式被標記為了遺留函式而不推薦使用。在POSIX.1-2008標準里已經沒有這些函式了。推薦使用memset替代bzero。
在android7.0中使用<strings.h>
否則提示:
test.c:20:6: error: implicitly declaring library function 'bzero' with type 'void (void *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
bzero(&newtio, sizeof( newtio ));
^
test.c:20:6: note: include the header <strings.h> or explicitly provide a declaration for 'bzero'

相關詞條

熱門詞條

聯絡我們