Electronic – “Invalid expression” error when compiling PIC C code


I am working in a project using a Nokia 5110 LCD, a PIC16F84A, and code in mikroC. When compiling the code, I get an "Invalid expression" error in line 16. This code comes from an example in the library docs. Any idea what I can do to fix it?

const char erste_Bild504; // Use the mikroC PRO for PIC integrated Glcd Bitmap Editor 3310 to
//convert image to a constant array
// Nokia 3310 or 5110 LCD pinout settings
sbit Nokia_3310_SCLK at RB0_bit;
sbit Nokia_3310_SDA at RB1_bit;
sbit Nokia_3310_DC at RB2_bit;
sbit Nokia_3310_CS at RB3_bit;
sbit Nokia_3310_REST at RB4_bit;
// Pin direction
sbit Nokia_3310_SCLK_dir at TRISB0_bit;
sbit Nokia_3310_SDA_dir at TRISB1_bit;
sbit Nokia_3310_DC_dir at TRISB2_bit;
sbit Nokia_3310_CS_dir at TRISB3_bit;
sbit Nokia_3310_REST_dir at TRISB4_bit;
unsigned short i=0;
char * txt=”000”;
void short_to_String(unsigned short j){
void main() {
Nokia_3310_LCD_Init();// initialize the Nokia 3310 or 5110 LCD
Nokia_3310_LCD_Clear();// Clear the Nokia 3310 or 5110 LCD
Nokia_3310 _Write_Text(“willkommen”,5,1); // write text
Nokia_3310_LCD_Clear();// Clear the Nokia 3310 or 5110 LCD
Nokia_3310 _Image (erste_Bild);// Draw picture
Nokia_3310_LCD_Clear();// Clear the Nokia 3310 or 5110 LCD
  short_to_String(i); // convert short to string
  Nokia_3310 _Write_Text(txt,40,3);//write text

Best Answer

MarkU's comment is correct. When using strings in C, you need to use normal quotation marks (""), not smart quotes. Microsoft Word automatically converts normal quotes to smart quotes, so don't edit code in Word. Don't even copy and paste into Word. (Alternately, you can turn off the automatic conversion.)

You will also need to fix line 25.