C标准库源代码

源代码在线查看: strlen.c

软件大小: 1707 K
上传用户: yl810406
关键词: 标准库 源代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				/***
				*strlen.c - contains strlen() routine
				*
				*       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
				*
				*Purpose:
				*       strlen returns the length of a null-terminated string,
				*       not including the null byte itself.
				*
				*******************************************************************************/
				
				#include 
				#include 
				
				#ifdef _MSC_VER
				#pragma function(strlen)
				#endif  /* _MSC_VER */
				
				/***
				*strlen - return the length of a null-terminated string
				*
				*Purpose:
				*       Finds the length in bytes of the given string, not including
				*       the final null character.
				*
				*Entry:
				*       const char * str - string whose length is to be computed
				*
				*Exit:
				*       length of the string "str", exclusive of the final null byte
				*
				*Exceptions:
				*
				*******************************************************************************/
				
				size_t __cdecl strlen (
				        const char * str
				        )
				{
				        const char *eos = str;
				
				        while( *eos++ ) ;
				
				        return( (int)(eos - str - 1) );
				}
							

相关资源