#include<stdio.h>
#include<conio.h> // needed for getche( )

int main(void)
{

char choice;

do
{
    printf("This is a simple test. Do you want to continue? y/n ");
     // this will echo the entry back to the screen
     // getch( ) will not echo to the screen
    choice= getche();
     printf("\n");
}while(choice=='y' || choice=='Y');
    printf("GOODBYE\n");
 
    return 0;
}

If you would like, I can add some other unnecessary or impolite comments here.
----- Original Message -----
Sent: Sunday, October 24, 2004 6:08 PM
Subject: Re: [c-prog] Novice question - Continue (Y/N)

Hopefully the moderator want scald me for persistent
asking newbee questions :-) but..... I want to come
back to my previous example. I wanted to use do while
loop and the comuter still cannot loop the operation.
Take a look on the code and output. (Coming back to
Yin's comment about main() - well that's how I'm
thaught to write my introductory programs - reffer to
"The C programing Language" - Brian W.Kernighan, Denis
M. Ritchie - not a great book and definitely not well
written for cleless.

Thanks but....

that is what I'm getting when testing the following
code:

--------------------------------------------

#include<stdio.h>
main()
{

char choice[1];

do
{
      printf("This is a simple test. Do you want to
repeat
me?\n");
      printf("continue y/n");
      printf("\n");
      scanf("%c",choice);
}
while(choice=='y' || choice=='Y');

printf("GOODBYE\n");
}
--------------------------------------
OUTPUT
--------------------------------------

css2c2% cc sample.c
"sample.c", line 1: warning: invalid white space
character in directive
"sample.c", line 14: warning: improper pointer/integer
combination: op "=="
"sample.c", line 14: warning: improper pointer/integer
combination: op "=="
"sample.c", line 17: warning: newline not last
character in file
css2c2% a.out

This is a simple test. Do you want to repeat me?
continue y/n
y
GOODBYE
css2c2%

-------------------------------------------------

Grrrrrrrr. Whats wrong with it?/

Regards

Kinga





--- "Thomas J. Hruska"
<[EMAIL PROTECTED]> wrote:

> At 02:38 PM 10/24/2004 +0800, Yin Ming writeth:
> >Oh, pardon me, I was too impolite. And, as I said,
> I'm a novice too,
> >let's share our experiece and advance together.
>
> Quick question:  Why are non-English-speakers so
> "mushy" with the English
> language?  "Let's share our experience and advance
> together" sounds like
> someone desperate for a date.  If you are wanting a
> date that badly, there
> is a simple solution to the problem:
>
> http://www.completeevil.com/geek.html
> (The Girl's Guide to Geek Guys - the definitive
> edition)
>
> Okay, jesting aside, I _want_ people to be nice on
> the list, but there is a
> point where I think people are just being overly
> nice for the sake of
> future mooching purposes...especially when people
> feel like they have
> stepped on someone else's toes they get all overly
> sensitive about each
> other's feelings.  I mean, lawsuits aren't going to
> fly here (I'll ban
> anyone from c-prog if they decide to sue someone
> else instead of settling
> an issue peaceably).  So, all I'm looking for is a
> teensy cut back on the
> mooching end of things.  A simple, "Sorry if I was
> sarcastic, I'll be
> better in the future," reply is sufficient.
>
> This isn't me playing the moderator role here.  Just
> general observations
> of the past few months and suggesting a few ideas on
> improving thread
> quality.  I understand non-native English speakers
> try really hard to sound
> good to the English speakers here (I have good
> friends from Singapore, Hong
> Kong, and Korea and know how difficult it is for
> them).  A nice gesture,
> but the finer points of the language really grind
> like sandpaper on the
> mind when used incorrectly (the same is true for
> those learning your
> respective languages).  I'm just giving a tip here
> on improving post
> quality.  Personally, I enjoy reading and writing
> e-mail "essays."  My own
> e-mails are typically first-draft quality riddled
> with errors.
>
> Of course, I don't remember what I said that was
> sarcastic, so I would have
> to go check the archives.  If I forgot it, then
> don't take it personally.
> E-mail is one of those outlets and sometimes forget
> someone real is on the
> other end.  I really need to get out more :)
>
>
> Thomas J. Hruska
> [EMAIL PROTECTED]
>
> Shining Light Productions
> Home of the Nuclear Vision scripting language and
> ProtoNova web server.
> http://www.slproweb.com/
>
>
>
>



           
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com


To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.




To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=:HM/A=2128215/rand=470829232


Yahoo! Groups Links

Reply via email to