虽然warning不影响运行,但有没有办法去掉warning

the_ray_of_AI 2019-12-27 03:19:56
#include<stdio.h>

int * maxfinder(int To_be_fouded_arrey[10]);
int main (void)
{
int temp;
const int storeArrey[10] = {1,2,3,4,5,6,7,8,9,10};

temp = *maxfinder(storeArrey);
printf("The max value stored in the arrey is %i \n",temp);

return 0;
}

int * maxfinder(int To_be_fouded_arrey[10])
{
int i;
int *finderPtr;
finderPtr=To_be_fouded_arrey;
for(i=1;i<10;i++)
{
if(finderPtr<To_be_fouded_arrey+i)
{
finderPtr=To_be_fouded_arrey+i;
}
}
return finderPtr;
}
...全文
380 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
源代码大师 2021-05-06
  • 打赏
  • 举报
回复
希望对你有帮助:https://blog.csdn.net/it_xiangqiang/category_10581430.html 希望对你有帮助:https://blog.csdn.net/it_xiangqiang/category_10768339.html
the_ray_of_AI 2019-12-28
  • 打赏
  • 举报
回复
引用 2 楼 寻开心的回复:
const int storeArrey[10] = {1,2,3,4,5,6,7,8,9,10}; 这里把const 去掉,是第二种改法

前面的增加cosnt的地方要改造多处
Thanks.😁😁😁
寻开心 2019-12-27
  • 打赏
  • 举报
回复
const int storeArrey[10] = {1,2,3,4,5,6,7,8,9,10}; 这里把const 去掉,是第二种改法

前面的增加cosnt的地方要改造多处
寻开心 2019-12-27
  • 打赏
  • 举报
回复
int * maxfinder(const int To_be_fouded_arrey[10]); 这样就好

69,369

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧