|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
想找一个用MIPS实现的下面字符串程序,找了一下午,没有,哪位帮帮忙?谢谢!!
1.strcat (s1,s2)
appends a copy of string s2,including the terminating null
character, to the end of string s 1. The function returns a pointer to the null-
terminated result. The initial character of s2 overrides the null character at the
end of s 1.
2.strcmp(sl,s2)
compares two strings byte-by-byte. The function returns an
integer greater than, equal to, or less than 0, if the string pointed to by s 1 is
greater than, equal to, or less than the string pointed to by s2 respectively.
The sign of a non-zero return value is determined by the sign of the difference
between the values of the first pair of bytes that differ in the strings being
compared. Bytes following a null byte are not compared.
3.strcmpi(s1,s2)
this function performs in the same manner as strcmp, except that
it considers both the lower and upper case version of a letter to be the same
character. Hint: study the ASCII table in binary.
4.strstr(sl,s2)
locates the first occurrence of the string s2 in the string s1
(excluding the terminating null character). The address of the start of the
located stringy (or 0 if the stringy is not found) is returned. |
|