the problem about Function Pointer and Array~~~

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

the problem about Function Pointer and Array~~~

3,728 次查看
eos33
Contributor I
hi there,
I am try to define the array for LCM display and want to write a function for it.
like this..
 
const Byte pic[ ] ={......................}
 
main(){
..
show_pic(pic);
..}
 
void show_pic(char *ptr){
......}
 
But while I am compiling,the compiler shows the message
If I denfine the array in the RAM,then the compiler could finish the compiling.
Byte pic[ ]={......}
 
thank you for your kindly help..:smileywink:
标签 (1)
0 项奖励
回复
2 回复数

1,110 次查看
CrasyCat
Specialist III

Hello

I assume you are using CodeWarrior for HC08 V5.x.

In fact the compiler notifies you that you have passed a constant pointer to character to a function expecting a pointer to character.

This message is a warning per default as required by ANSI C standard.

You can disable this warning activating the option -Ec.

I hope this helps.

CrasyCat

0 项奖励
回复

1,110 次查看
eos33
Contributor I
Hi CrasyCat ,
 
thank you for your help.
it really solved the problem..:smileyhappy:
0 项奖励
回复