Your array is too small, you only allocated space for only one int element.
int* x = new int;
correct way: int* x = new int [ the amount you need ];
while ( b != 0 )
{
x[counter_x] = b;
cout << x[counter_x] << " ";
counter_x++;
b--;
}
In your loop you index out of your array. The program is trying to access areas of the memory, which don't belong to it, and thats why you got that memory access violation error.