Webastor - Programming Tips and Tricks

Programming language => C++ => Topic started by: Omar on November 17, 2016, 07:04:54 PM

Title: How do I take input in c++?
Post by: Omar on November 17, 2016, 07:04:54 PM
Hello everyone, I would like to ask you for more information, how do i take input in c++? Please kindly give me your opinion as soon as possible by return message.
Title: Re: I take input in c++?
Post by: Khalid on December 29, 2016, 07:14:35 PM
 the standard input by default is the keyboard, and the C++ stream object defined to access it is cin.

For formatted input operations, cin is used together with the extraction operator, which is written as >> (i.e., two "greater than" signs). This operator is then followed by the variable where the extracted data is stored. For example:

1
2
int age;
cin >> age;