在C程序中获取错误请帮助我 [英] Getting errors in C program please help me out

查看:93
本文介绍了在C程序中获取错误请帮助我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

void maxarea(int tarr[],int count)
 {
     int i,p,j;
     p=tarr[0]*tarr[1];
     for(i=0;i<count;i++)
     {
         for(j=i+1;j<count;j++)
         {
             if((tarr[i]*tarr[j])>p)
                p=tarr[i]*tarr[j];
         }
     }
    printf("%d",p);
 }









此函数用于计算数组元素的最大可能产品,数组被传递给函数



现在代码块的错误现在是出现的功能的结束/>
预期'=',',',';','asm'或'_attribute_'在输入结束时

PLS帮助



我尝试了什么:



i不知道函数plzz出了什么问题帮助我删除错误





This function above is for calculating the maximum product possible of array elemets ,the array being passed to the function

NOW THE ERROR ACCORDING TO CODE BLOCKS IS AT THE END BRACE OF THE FUNCTION WHICH SAYS
expected '=',',',';','asm' or '_attribute_' at the end of input
PLS HELP

What I have tried:

i don't know what's going wrong with the function plzz help me out to remove the error

推荐答案

不要假设它在代码中:它可能是上面的函数有一个不匹配的括号导致编译器给你文件末尾的错误。

如果你将输入置于一个开放的括号,许多IDE使用CTRL + {/ CTRL + [或CTRL +} / CTRL +]跳转到匹配的近括号 - 试一试,看看你是否有任何括号a重新丢失或虚假。
Don't assume it's in that code: it may well be that a function above that has an unmatched bracket that is causing the compiler to give you the error at the end of the file.
Many IDE's use CTRL+{ / CTRL+[ or CTRL+} / CTRL+] to "jump" to the matching close bracket if you position the input at an open bracket - give it a try and see if any of your brackets are missing or spurious.


我在这段代码片段中看不到任何明显的东西。

使用编辑器功能:

- 使用re-indentation看看是否出现了什么。

- 使用括号匹配来查看开头的括号中的哪一个。

- 注释掉你的一些代码以查看效果在错误消息上。
I see nothing obvious in this code snipset.
Use editor features:
- use re-indentation to see if something appears.
- use parentheses matching to see where is the closing parenthesis for an opening one.
- comment out some pieces of your code to see the effect on the error message.


这篇关于在C程序中获取错误请帮助我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆