the problem about Function Pointer and Array~~~

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

the problem about Function Pointer and Array~~~

3,030 Views
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:
Labels (1)
0 Kudos
2 Replies

412 Views
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 Kudos

412 Views
eos33
Contributor I
Hi CrasyCat ,
 
thank you for your help.
it really solved the problem..:smileyhappy:
0 Kudos