is there any way to write a number to a file simultaneously receiving it from user without being pressed enter...
i want the number to be entered in a file and at the same time as the user enters the numbers,they should be entered into a file.i am trying the following code...but that doesnt seem to work
Well, you could do it by capturing keystrokes, but the way I would suggest is non-standard and non portable, using getch() or similar.
But, what if the user makes an error and wants to press backspace or correct some mistyped value? You could handle that too, but really, I'd recommend getting the input as a string, and after that, write the string to the file.