📄 memset.c
字号:
/****************************************************************Copyright 1990 by AT&T Bell Laboratories and Bellcore.Permission to use, copy, modify, and distribute this softwareand its documentation for any purpose and without fee is herebygranted, provided that the above copyright notice appear in allcopies and that both that the copyright notice and thispermission notice and warranty disclaimer appear in supportingdocumentation, and that the names of AT&T Bell Laboratories orBellcore or any of their entities not be used in advertising orpublicity pertaining to distribution of the software withoutspecific, written prior permission.AT&T and Bellcore disclaim all warranties with regard to thissoftware, including all implied warranties of merchantabilityand fitness. In no event shall AT&T or Bellcore be liable forany special, indirect or consequential damages or any damageswhatsoever resulting from loss of use, data or profits, whetherin an action of contract, negligence or other tortious action,arising out of or in connection with the use or performance ofthis software.****************************************************************//* This is for the benefit of people whose systems don't provide * memset, memcpy, and memcmp. If yours is such a system, adjust * the makefile by adding memset.o to the "OBJECTS =" assignment. * WARNING: the memcpy below is adequate for f2c, but is not a * general memcpy routine (which must correctly handle overlapping * fields). */ intmemcmp(s1, s2, n) register char *s1, *s2; int n;{ register char *se; for(se = s1 + n; s1 < se; s1++, s2++) if (*s1 != *s2) return *s1 - *s2; return 0; } char *memcpy(s1, s2, n) register char *s1, *s2; int n;{ register char *s0 = s1, *se = s1 + n; while(s1 < se) *s1++ = *s2++; return s0; }memset(s, c, n) register char *s; register int c; int n;{ register char *se = s + n; while(s < se) *s++ = c; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -