>
>Hopefully the moderator want scald me for persistent
>asking newbee questions :-) but..... I want to come
I try to not bite :) And this group is designed to welcome newbies to
C/C++. You'll probably get told to search Google often for answers by
others - others will give solutions, and everyone tries to solve other
people's problems in the midst of pedantic discussion over the finer points
of C/C++.
>#include<stdio.h>
#include <stdio.h>
(Missing the whitespace between #include and <stdio.h>).
>main()
>{
>
>char choice[1];
char choice;
>do
>{
> printf("This is a simple test. Do you want to
>repeat
>me?\n");
> printf("continue y/n");
> printf("\n");
> scanf("%c",choice);
If you have to use scanf:
scanf("%c", &choice);
Something less portable would be getch() under Borland or the ncurses
library under Linux, but pretty much anything is technically better than
scanf() (I personally prefer fgets(), but single character entries usually
warrants a different solution). It looks like you are using gcc and/or cc,
so I'll assume Linux and recommend looking into using ncurses.
>}
>while(choice=='y' || choice=='Y');
>
>printf("GOODBYE\n");
>}
Thomas J. Hruska
[EMAIL PROTECTED]
Shining Light Productions
Home of the Nuclear Vision scripting language and ProtoNova web server.
http://www.slproweb.com/
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.
