求助!!c语言函数以指针形式调用数组如何实现?
<br />此处定义的数组,在下面供函数调用,编译总是出错,尝试了很多办法还是不行,希望高手能指点一下~~~~~如果要能正常调用该数组,该如何改正或者用其他办法如何实现?小弟不甚感激~~~~<br /><br /><br />unsigned char Inputdata_1 <br /><br />void Display(int addr) //此处改成过指针的形式,但是后面没改,编译依然无法通过<br />{<br /> <br /> int_t i,j;<br /> int_t a,b;<br /> TempBuffer_img = addr; <br /><br />}<br /><br />void mian()<br />{<br />Display(Inputdata_1)<br /><br />}<br /><br /><br /><br />附:编译错误提示<br /><br />"main.c", line 53: cc0142: error: expression must have pointer-to-object type<br /> TempBuffer_img = addr;<br /> ^<br /><br />编译软件对此错误的解释:<br /><br />Compiler Error: expression must have pointer-to-object type<br /><br />Description<br /><br />The expression used does not have a pointer-to-object type. <br /><br />Severity<br /><br />Fatal error<br /><br />Recovery<br /><br />The compiler cannot recover from this error.<br /><br />Example<br /><br />int a;<br /><br />int main()<br />{<br />return a; /* Error occurs here */<br />}<br /><br />How to Fix<br /><br />Ensure that the expression used has a pointer-to-object type. The lvalue must be for a scalar, and if it is a pointer, it must point to an object.<br /><br />One of the operands must have a pointer-to-object type, and the other one must be an integral expression. You can make the above example compile by either changing the declaration "int a;" to "int a[];" or by changing the return statement to "return a".<br /><br /><br /><br />i,j都没赋值
页:
[1]