the problem about Function Pointer and Array~~~

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

the problem about Function Pointer and Array~~~

3,718件の閲覧回数
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,100件の閲覧回数
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,100件の閲覧回数
eos33
Contributor I
Hi CrasyCat ,
 
thank you for your help.
it really solved the problem..:smileyhappy:
0 件の賞賛
返信