0
what is cin
2 Respostas
+ 3
hi,
The predefined object cin is an instance of istream class. The cin object is said to be attached to the standard input device, which usually is the keyboard.
The cin is used in conjunction with the stream extraction operator, which is written as >> which are two greater than signs as shown in the below example.
#include <iostream>
using namespace std;
int main( ) {
char name[50];
cout << "Please enter your name: ";
cin >> name;
cout << "Your name is: " << name << endl;
}
when this code executed it will ask name then it will print the name.
+ 1
cout <<
//
cin >>
cout is an OUTput for your app
cin is an INput.
Ex :
int userInput;
cin >> userInput;
cout << userInput;
//invites the user to select a number and show it