Mail Archives: djgpp/1998/10/02/23:21:42
Hi, I've got a project due in school. What the project is is to do the
following:
Accept and echo characters on screen using conio.h functions. Here's the
catch, though. You have to accept three sentences, interpreting a sentence
as whenever the return button is pressed, and you can't echo anything
between two parentheses marks.
Note: I DON'T WANT YOU TO SOLVE THE PROGRAM FOR ME. I like solving these
things. I just need a push in the right direction. Here's what I got so far:
#include <conio.h>
void main()
{
int character_count, word_count;
char store_char='a';
for (word_count = 1; word_count<=3; word_count++)
{
do
{
store_char=getche();
if (store_char='(')
{
putch('\b');
while (store_char != ')')
{
store_char=getch();
}
}
else
character_count++;
} while (store_char != '\r');
}
}
Any thoughts?
---------------------------------------------------------------------------
John Meyer
john_meyer AT geocities DOT com
Life and Leisure Editor-USC Today
http://www.uscolo.edu/usctoday
"Anyone who fights for the future, lives in it today" -Ayn Rand
"Bad Cop! No Donut!"
---------------------------------------------------------------------------
- Raw text -