> But I need to access a variable, defined in asm like this: > GLOBAL disp_digits > > UDATA > disp_digits res 5 > > > What would be the correct way to define that variable in C? > I tried this: > extern unsigned char disp_digits[5]; > main(){ > disp_digits[0]="0"; > disp_digits[1]="1"; > disp_digits[2]="2"; > disp_digits[3]="3"; > > But compiler complains: > main_lcd_disp.c:37: error 47: indirections to different types assignment > from type 'const-char [2] code' > to type 'unsigned-char fixed'
You try to assign a string literal ("0") to a char. You need single quotes ('0') if you want disp_digits to hold the ASCII character '0' (or simple 0 if you want to store the ASCII NUL, the character with the encoding value of 0). Good luck Raphael ------------------------------------------------------------------------------ vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user