Q:

Failcheck message gets repeated for the same amount of invalid characters contained inside the wcin

I am currently getting back to programming and started with a simple second degree equation calculator. I'm getting an unexpected behavior which I have no idea why is happening.
I have a while that checks if the values of a, b and c are numerical, with a fail message if they are not. But the fail message gets repeated for the same amount of invalid characters inside the unacceptable input.
Here is the code:
wcout << "Insert a value for a: \n";
wcin >> a;
while (wcin.fail())
{
    wcin.clear();
    wcin.ignore();
    wcout << L"Please insert a numerical value.\n";
    wcin >> a;
}

Example of the problem described.
   If someone knows what is going on, I'd appreciate the help
EDIT: I am using wcout and wcin because of UNICODE characters such as letters with accent marks and greek symbols. I don't know if this problem could be related to this, but often I get the error saying "wcin/wcout is ambiguous"

A:

While wcin.clear() only sets the stream error state flags, the input stream must be reset, for example by wcin.ignore(...)
If you use wcin.ignore() it will use default parameters (see here): one character or the end of file condition.
Entering "aaa" will only extract an 'a', the rest remain in the input, which will be re-tested again in the next while-loop.
Entering from the console usually implies the 'Enter' key, whose character is '\n'. This is the delimiter we need to use to reset the input:
wcin.ignore(100, '\n');

Notice I've written 100. If you want to discard any number of characters then you need:
#include <limits>
....

wcin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');

