c语言中关于函数调用的3道题求解1.Write the function fun,which computes the result of ,and use the main function to call this function for testing.2.Write the function strrindex (s,t),which returns the position of the rightmost occurrence
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/22 23:01:36
c语言中关于函数调用的3道题求解1.Write the function fun,which computes the result of ,and use the main function to call this function for testing.2.Write the function strrindex (s,t),which returns the position of the rightmost occurrence
c语言中关于函数调用的3道题求解
1.Write the function fun,which computes the result of ,and use the main function to call this function for testing.
2.Write the function strrindex (s,t),which returns the position of the rightmost occurrence of t in s,or -1 if there is none.
3.Imitating the function atoi,which can convert the numeric string to an integer?
麻烦各位把代码给我 一定要是能够运行的代码 如果好的话
c语言中关于函数调用的3道题求解1.Write the function fun,which computes the result of ,and use the main function to call this function for testing.2.Write the function strrindex (s,t),which returns the position of the rightmost occurrence
1. fun计算什么的结果啊 是不是好了
#include
const char* fun()
{
return "Test fun witch return a const-cstring";
}
void main()
{
printf("%s", fun() );
}
2
int strrindex (const char* s, chat t)
{
int len = strlen(s);
while (len)
{
len--;
if (*(s-len) == t)
return len;
}
return -1;
}
3.
int atoi(const char* s)
{
int n=0;
while (*s >= '0' && *s