C++ を学習しようとしているので、ポインターと動的メモリをいじっていましたが、コンパイル時にこのエラーが発生し続けます。
error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::istream' (or there is no acceptable conversion)
私のコードは次のとおりです。
int * ageP;
ageP = new (nothrow) int;
if (ageP == 0)
{
cout << "Error: memory could not be allocated";
}
else
{
cout<<"What is your age?"<<endl;
cin>> ageP; <--this is the error line
youDoneIt(ageP);
delete ageP;
}
何か案は?助けてくれてありがとう。