Small curses program not displaying

Please tell me what I have done wrong in the following code extract.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
while(1)
        {
        j = 0;
        while((i = wgetch(xwin)) != EOF)
            {
            if ((i == 0x51) || (i == 0x71) || (i == 0x1B)) break; // q or Q or ESC
            InputString[j++] = i;
            }

        if ((i == 0x51) || (i == 0x71) || (i == 0x1B)) break; // q or Q or ESC
        // check for carriage return/line feed & remove same
        if ((InputString[strlen(InputString)] == 0x0A) || (InputString[strlen(InputString)] == 0x0D))
            {
            strncpy(OutputString, InputString, strlen(InputString)-1);
            }
        else 
            {
            strcpy(OutputString, InputString);
            }

        Result = mvwaddstr(xwin, y, x, OutputString);
        if (Result != 0) waddch(xwin, Result);

//          while((i = wgetch(xwin)) != EOF) waddch(xwin, i);
        wmove(xwin, ++y, x);
        wrefresh(xwin);

the mvwaddstr does not display even though I know I am getting characters from the keyboard.
InputString also apparently does not get populated? Help please.
is it eof? because in fstream its object_name.EOF
It is not EOF and until it is EOF, in my opinion, each character should end up in InputString.
Topic archived. No new replies allowed.