S
shan
Can any one tell me an Input function that terminate by pressing
spacebar and not return key.
Functions like scanf,getchar,getc when invoked they allow whatever
typed after a space they terminate by pressing enter only.
I am using turboc++.
consider the following program in which 2 matrices are given by user.
for(i=0;i<rows;i++)
{
for(j=0;j<cols;j++)
{
if ('\n'==getchar())
break;
else
scanf("%d",& b[j]);
}
}
the matrix should be inputted in the form 1 2 3
4
5 6
7
8 9
So after each space j should be incremented.After each return i should
be incremented.
spacebar and not return key.
Functions like scanf,getchar,getc when invoked they allow whatever
typed after a space they terminate by pressing enter only.
I am using turboc++.
consider the following program in which 2 matrices are given by user.
for(i=0;i<rows;i++)
{
for(j=0;j<cols;j++)
{
if ('\n'==getchar())
break;
else
scanf("%d",& b[j]);
}
}
the matrix should be inputted in the form 1 2 3
4
5 6
7
8 9
So after each space j should be incremented.After each return i should
be incremented.