A very short program
#include <iostream>
using namespace std;
int main()
{
cin>> int x;
return 0;
}
it's not compiling, why can't declare after cin?
A very short program
#include <iostream>
using namespace std;
int main()
{
cin>> int x;
return 0;
}
it's not compiling, why can't declare after cin?
cin is the object in c++ of class istream. It is Used to accept the input from input devices like keyboard and int x; is declaration of variable i.e. allocating the space where our number from input stream will get stored.>> is extraction operator which receives the stream.So declaration and taking input are 2 different things. 1) allocate memory(int x)2)write into it. These 2 things won't happen together.