What is the difference between reading from console and reading from keyboard?

Hello. I have 2 different assignments; one asks me to "Read a string from the keyboard and display it" and the other "Read a string from console and display it". What is the difference between these two? I tried google but with no result.

 
well I think reading from a keyboard is self explanatory.

You'll have to ask for clarification on "Read a string from console and display it".
I think it could also mean reading from the keyboard.
More liekly it could mean reading from the command line, such as
c:\runmyprogram 1 2 3 4
Where 1 2 3 and 4 is the data input.
Not very likely but I guess it might even mean run a console command and get the input from a file.
I think they probably mean the same thing, i.e. use std::cin to read string.
I would agree they are the same and mean "use cin". Technically the console reads the hardware and passes it on to your program, which is different from actually reading the hardware yourself (which is not trivial at all). I don't think anyone would ask a beginner to *really* read from the keyboard (as a device).

which, if you did manage to beat a result out of google, is what you might get... how to read the hardware... not pretty :)
Last edited on
Write your programs to read from standard input (use std::cin)
https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)
Topic archived. No new replies allowed.