C语言库函数的原型,有用的拿去

源代码在线查看: strchr.c

软件大小: 3272 K
上传用户: kens
关键词: C语言 库函数 原型
下载地址: 免注册下载 普通下载 VIP

相关代码

				/***
				*strchr.c - search a string for a given character
				*
				*       Copyright (c) Microsoft Corporation. All rights reserved.
				*
				*Purpose:
				*       defines strchr() - search a string for a character
				*
				*******************************************************************************/
				
				#include 
				#include 
				
				/***
				*char *strchr(string, c) - search a string for a character
				*
				*Purpose:
				*       Searches a string for a given character, which may be the
				*       null character '\0'.
				*
				*Entry:
				*       char *string - string to search in
				*       char c - character to search for
				*
				*Exit:
				*       returns pointer to the first occurence of c in string
				*       returns NULL if c does not occur in string
				*
				*Exceptions:
				*
				*******************************************************************************/
				
				char * __cdecl strchr (
				        const char * string,
				        int ch
				        )
				{
				        while (*string && *string != (char)ch)
				                string++;
				
				        if (*string == (char)ch)
				                return((char *)string);
				        return(NULL);
				}
							

相关资源