I am running this code on an XC161
#include <stdlib.h> #include <string.h> #define WIN_MAXTEXT 128 #define WIN_TEXTLEN 21 typedef struct { int count; int top; char caption[WIN_TEXTLEN+1]; char lines[WIN_MAXTEXT][WIN_TEXTLEN+1]; } WIN_TEXT; static WIN_TEXT win_text; static char *line = "Hello World"; void main(void) { WIN_TEXT *text; char *s,*d; int i; text = &win_text; if ( text->count<WIN_MAXTEXT ) { d = text->lines[text->count++]; s = line; for ( i=0 ; *s && i<WIN_TEXTLEN ; i++ ) *(d++) = *(s++); *d = '\0'; } }