You need to check the return value of the stream when it tries to convert to the number. You can do this with the stringstream or directly with cin. For example, to do it with cin you could do:
You should #include <limits> and #include <ios> for the stuff in the ignore line, or you can just use cin.ignore(1000, '\n');.
while (!(cin >> number))
cin.clear(); // clear failbit from character
cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); // ignore bad input
cout<<"U've entered not an integer!!"<<endl;
If you wanted to use the stringstream version, you would do basically the same thing. Check the state of the stream after it tries to convert to an int.