Id like to see how this CodevisionAVR compiler compares to the keil
>compiler, but I cant get it to compile a function where I pass a
>character string...
>
>
>#define MSG_A " "
>#define MSG_B " "
>
>void Update_LCD(char* first_line, char* second_line)
>{
> //Do Something
>}
>
>void main (void)
>{
> Update_LCD("Hello", "World"); //Doesnt work
> Update_LCD( MSG_A MSG_B); //Doesnt work
>}
>
>
>This compiles and works fine with the Keil, but with the CodevisionAVR
>I get a "function parameter #1 incompatible with its declaration"
>error. Is the way Im doing it violate some ANSI C rule, or does
>Codevision need to have it done differently?
Try your prototype as: void Update_LCD(const char *first_line, const char *second_line);
A string constant is not modifiable but your original function prototype will imply to the compiler that the objects pointed to by the arguments may be modified by the function. Since a string literal like this will probably be created in, and remain in, non-modifiable memory in the AVR (i.e., flash) this is a good assumption.