I am doing it just want to confirm whether I'm doing right
If you're using cin you'll probably take the entire equation in as a character array (char*). You'll need to break the equation up so that you keep your numbers and cast them as you want them (ints, doubles, floats....). Tokenizing is one way to do this, but may be a bit much for one line of text. Also find a way to keep the operator.
Once you have your numbers and operator, run your own check on the equation. If someone typed in 2+3 = 5, take 2 + 3 and compare the output with 5. If the user is always going to use integers, I suggest keeping your numbers as ints to prevent loss of information. If someone types 6.25 / 3.14159... = 2, you're probably going to need a range of acceptable answers because when the computer does the calculation, it will never come up with 2 unless you round your final answer to an int.
- Miles