On Thu, 17 Sep 1998, [ISO-8859-1] Torbj�rn Kristoffersen wrote:

>   {
>      printf("hit enter for the next page..\n");
>      getchar();
>   }
> }
> 
> but it didn't work, has anyone got a solution to my little problem? 

It isn't possible to say why it didn't work because you have
not supplied enough information. So I'll do some guessing.
 
getchar() gets the next character in the stdin buffer, which 
can cause headaches if you expect it to get the last character 
entered from the keyboard. 

#define pagelen 24 
/*                  for a 25 line monitor */

for(n=1;;n++){

        /* do whatever, if the data is in an array with no newline 
        use something like puts(myline[n-1]);
        */

        if( !(n%pagelen) )
                {
                printf(" --- hit enter for next page --- ");
                fflush(stdout);
                while( '\n' != getchar());
                }
        }





Reply via email to