Correct, except that the memory area needs not be dynamic. A global or stack-local array can have the same effect. And except that your pointer names don't match.
However, the second example is very prone to future buffer overflow:
Code:
char *pString = new char[10];
// Lots of code
// And I mean really lots.
// This protects against the overflow when using >>
cin >> setw(9) >> pString;
Great. Later someone comes along and decides that he needs 12 characters read. This is where the "magic numbers" game comes in.
Code:
char *pString = new char[10];
// Lots of code
// And I mean really lots.
// This protects against the overflow when using >>
cin >> setw(12) >> pString; // Ouch! Reading too much, other number not changed.
So you see, overflowing a buffer is very easy. The best solution, usually, is to avoid doing your own memory management.
Code:
std::string str;
cin >> str; // Cannot overflow