Hi, Im trying to display string to lcd using following code:

void LCD_String(unsigned char *s)
{
LCD_Char(*s);
LCD_Char(*(s+1));
LCD_Char(*(st+2));
LCD_Char(*(s+3));
return;
}

called with LCD_String(text); in main(),  text is unsigned char text[10]; 
declared outside main() and initialized with "Test\0" in main().
Program displays just T[glyph/rand char][glyph/rand char][glyph/rand char]
[glyph/rand char].

But:
void LCD_String(unsigned char *s)
{
LCD_Char(*s);
s=text;
LCD_Char(*(s+1));
s=text;
LCD_Char(*(st+2));
s=text;
LCD_Char(*(s+3));
return;
}
works fine and displays Test, so I suspect so LCD_Char(*s) call destroys s. 
Why is this happening and how can I prevent it? Thanks.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to