I want to read a String in a char array without using any of String class function, not even charAt(), lenght() in Java. I know one method char c=(char) System.in.read(). But in this, the user char write a whole sentence on command Line even for inputting a single char. I want that user will be able to type one character and then i can do some operations on it, then the next character on the same line....(as we do in c++) . Please give me some suggetstions. I want a code working similar like in c++
// c++ code
char c, d[50];
cin.get(c);
int i=0;
while(c != '\n')
{
d[i++]=c;
... //any expressions
...
cin.get(c);
}