主题:这个函数没见过啊???
chinazhaoxy
[专家分:30] 发布于 2009-01-19 12:25:00
在语句“p=strchr(xx[i],'\n')”中,变量p是事先定义的字符指针类型,求问“strchr”是什么函数?什么功能?
回复列表 (共4个回复)
沙发
htttg [专家分:20] 发布于 2009-01-19 20:36:00
该函数的功能是在前面的字符串中寻找后面的字符,返回发现的第一个目的字符向后的字符串(至空字符止)。
另:这类问题在MSDN中都可以找到答案,建议LZ装一个MSDN,对学习有很大的益处。
板凳
chinazhaoxy [专家分:30] 发布于 2009-01-28 12:15:00
[quote]该函数的功能是在前面的字符串中寻找后面的字符,返回发现的第一个目的字符向后的字符串(至空字符止)。
另:这类问题在MSDN中都可以找到答案,建议LZ装一个MSDN,对学习有很大的益处。[/quote]
不好意思啊,你说的 MSDN 和 LZ 是什么意思啊?中文全称是什么啊?
3 楼
zj54891 [专家分:20] 发布于 2009-01-29 12:13:00
MSDN 是帮助文件
所有函数的用法 都可以在MSDN中查到
你可以去网上下载个
4 楼
小小C [专家分:4570] 发布于 2009-02-03 18:37:00
strchr, wcschr, _mbschr
Find a character in a string.
char *strchr( const char *string, int c );
wchar_t *wcschr( const wchar_t *string, wint_t c );
unsigned char *_mbschr( const unsigned char *string, unsigned int c );
Routine Required Header Compatibility
strchr <string.h> ANSI, Win 95, Win NT
wcschr <string.h> or <wchar.h> ANSI, Win 95, Win NT
_mbschr <mbstring.h> Win 95, Win NT
For additional compatibility information, see Compatibility in the Introduction.
Libraries
LIBC.LIB Single thread static library, retail version
LIBCMT.LIB Multithread static library, retail version
MSVCRT.LIB Import library for MSVCRT.DLL, retail version
Return Value
Each of these functions returns a pointer to the first occurrence of c in string, or NULL if c is not found.
Parameters
string
Null-terminated source string
c
Character to be located
Remarks
The strchr function finds the first occurrence of c in string, or it returns NULL if c is not found. The null-terminating character is included in the search.
wcschr and _mbschr are wide-character and multibyte-character versions of strchr. The arguments and return value of wcschr are wide-character strings; those of _mbschr are multibyte-character strings. _mbschr recognizes multibyte-character sequences according to the multibyte code page currently in use. These three functions behave identically otherwise.
我来回复