Use getch() in a loop... It will not echo to the screen.. If you use getche() it will...
if you want to accept chars till enter is pressed without displaying on the screen...
Code:
# include <iostream.h>
int main()
{
char ch;
char array[1000];
int i=0;
while(ch!=13)
{
ch=getch();
if(ch!=13)
{
array[i]=ch;
i++;
}
if(i>=1000)
ch=13;
}
return 0;
}
so now the array[] will hold all the chars... There is a better way of doing this... For example now if you press back space, del etc it will also be taken as a char and stored in the array... You need more conditional statement to make this work perfect...