So I'm using cin
for taking input for a char array.
char mycroft[2];
cin>>mycroft;
cout<<mycroft;
It works fine. Now I'm using cin
for taking input for an int array:
int mycroft[2];
cin>>mycroft;
cout<<mycroft;
However, I am getting this error which I do not understand:
error: no match for 'operator>>' (operand types are 'std::istream {aka std::basic_istream}' and 'int [2]')|
Can someone please tell me why it's not working? Also my professor said taking input using cin
isn't advisable. To what extent is that true?