文件名称:projecttwo
-
所属分类:
- 标签属性:
- 上传时间:2016-05-19
-
文件大小:7.56kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
8.编写一个函数,实现两个字符串的比较,即自己写一个stringcmp 函数:stringcmp(s1,s2)。如果s1=s2,返回置为0;如果s1≠s2,返回它们二者第一个不同字符的ASCII码差值(如“BOY“与”BAD“第二个字母不同,”O“和”A”之差为79-65=14);如果s1>s2,则输出正值;如s1<s2,则输出负值,在主函数中输入字符串以及输出上述结果。(要求使用指针实现)- Write a function that compares two strings to achieve, that is to write a function stringcmp: stringcmp (s1, s2). If s1 = s2, return is set to 0 if s1 ≠ s2, returning them both the first difference of different characters in ASCII (such as BOY and BAD different the second letter, O and A the difference is 79-65 = 14) if s1> s2, the output value as s1 <s2, a negative value is output, the input string in the main function and outputs the result. (Requires the use of pointers)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
projecttwo.doc
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.