I tried to enter error data in next program but it can't recognize the error. Once I entered numeric data, and next time entered string data but the program made no reaction:
#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main(void)
{
int i;
scanf("%d",&i);
if(ferror(stdin))
printf("Error is ocurred!");
}