-----Original Message-----
From: owner-linux-c-programming   
[SMTP:[EMAIL PROTECTED]]
Sent: Friday, September 18, 1998 12:27 PM
To: Linux C Programming List
Subject: Re: prompt when 25 lines..

On Thu, 17 Sep 1998, Glynn Clements wrote:

 ->   if(n==25 || n==50)
 ->   {
 ->      printf("hit enter for the next page..\n");
 ->      getchar();
 ->   }
 -> }
 ->
 -> but it didn't work, has anyone got a solution to my little problem?
 -
 -In what way didn't it work? If it never prints the message, then it's
 -due to something in the `//other functions' section.

and consider resetting n to 0 after each screenful. That way you don't
need to check for n==25 || n==50 || n==75.....

if (n > 24) {
        printf ("Press <enter> for next page...\n");
        getchar();
        n=0; /* because we all know the screen really goes from 0->24 */
}
[subbaraom]  Why don't you use % (mod  opearator) in the following way
if ((n % 25) == 0) {
    printf("Press <enter> for next page ... \n);
    getchar();
}
 --
+++ Divide By Cucumber Error, Please Re-Install Universe And Reboot +++
[EMAIL PROTECTED]                    http://x-map.home.ml.org

Reply via email to