I'm writing a driver for a custom display which uses a menu system. I defining my text library I decided to use constant character arrays for my text. I then attempt to point to the individual characters for the printing of text. I am using version 3.129 of the compiler and am programming for a PIC18F6720. Here is what I am having problems with.

Now when I try to compile, the compiler stops when it gets to my function declaration, more specifically at the 'char' declaration and I get a message that says 'Expecting a , or )'. I've used this method with a couple other compilers and one being Microchips C17 and it worked fine. Is there a fix or some work around for this?
___________________________
This message was ported from CCS's old forum
Original Post ID: 10543

PCM programmer

Joined: 06 Sep 2003Posts: 20477

Re: const char pointer problem

Posted: Wed Jan 08, 2003 3:08 pm

:=I'm writing a driver for a custom display which uses a menu system. I defining my text library I decided to use constant character arrays for my text. I then attempt to point to the individual characters for the printing of text.
------------------------------------------------------
CCS doesn't allow pointers to constant strings.
If you want to pass a pointer, you first have
to copy the string into a ram array by using
the strcpy() function.

But you can still use constant strings.
The following program shows how you could
send the string to an RS-232 terminal, or
to an LCD.

Also, the printf() function can have its
output redirected to another function.
See the manual for info on this.