in the 2nd doubt i.e. int the given code u can use
the ascii value returned when the Esc key is pressed.
try this code within the while loop. the Esc key
returns 27
while(1)
{
if(kbhit())
{
c=getch();
if(c==27)
exit(1)
}
----------------
------------------
}
--- Harini <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
> I am having 2 doubts in C. Please help
> me.
>
> 1. What is meant by sequential file?
> 2. -------
> --------
> While(1)
> {
> printf(" \n Enter your choice");
> printf("\n 1-----display");
> printf("\n 2-----exit");
> scanf("%d",&choice);
> switch(choice)
> {
> case 1: display();
> break;
> case 2: exit(1);
> break;
> }
> }
> --------
> -----------
> In the above part of program, to terminate
> the program we need to enter 2. Now doubt is how to
> modify this program so that when esc key pressed the
> program should terminate.
>
> Bye,
> Harini
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Easier than ever with enhanced search.
> Learn more.
> http://info.mail.yahoo.com/mail_250
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
