cin>>x;
Here you are trying to put a value in a variable named x. But you never created a variable named x. You have to create variables before you can use them.
Here is an example showing how to create a variable named x. In this example, x is an int. int x;
Here is another example showing how to create a variable named x. In this example, x is a string. string x;
You need to show how this relates to the place where you declared x. Maybe post the complete code - or at least show enough to be able to reproduce the problem.