/* Define bzero() as a macro if it's not in standard C library. */#ifndef HAVE_BZERO#define bzero(ptr,n) memset(ptr, 0, n)#endif
另一个就是<strings.h>中已做包含:
C/C++ code
/* Set N bytes of S to 0. */extern void bzero (void *__s, size_t __n) __THROW;
我的疑问是:编译器在编译时,会选择哪个呢?? 再举一个例子: 程序中还用到信号处理函数
C/C++ code
signal(SIGCHLD,sig_chld);
此函数<signal.h>中也是包含的:
C/C++ code
/* Set the handler for the signal SIG to HANDLER, returning the old handler, or SIG_ERR on error. By default `signal' has the BSD semantic. */__BEGIN_NAMESPACE_STD#ifdef __USE_BSDextern __sighandler_t signal (int __sig, __sighandler_t __handler) __THROW;#else
此外,我也自己写了个signal函数的实现放在code::blocks的工程里,
C/C++ code
Sigfunc *signal(int signo, Sigfunc *func){.../* end signal */