0
c++ user input
I don't understand the working method of cin >> num. Please elaborate this.
2 ответов
+ 9
>> is an overloaded operator used for a method in the istream class.
cin is an object of type istream.
So, cin >> (args);
is calling the method that takes the users input.
+ 2
cin is an object with type std::istream. This class contains a method std::istream::operator>> which takes an argument, and stores the input in said argument. What this function exactly does depends on the OS, but for unix systems, it is almost the same as the "read" function, just with some things added, like splitting inputs if a space is written in the prompt.