Yes. Collecting characters and allowing the user to edit them is done by the operating system. The user signals that the line is complete by hitting "enter" and sending the charaters to the program.
Here is another run of the program:
Enter the data: Columbus sailed in 1492. You entered:Columbus sailed in 1492.
Notice that the characters '1', '4', '9', and '2' were read in and written out just as were the other characters. Now consider yet another run:
Enter the data: 1492 You entered:1492
Nothing special here. The '1', '4', '9', and '2' are just characters. If you want the user to enter numeric data, your program must convert from character data to a numeric type.
Can a string of digits from the keyboard be converted into an int
type?