How do I detect garbage chars in a CString. Actually I'm reading some data from COM port. In some certain condition it will give some garbage as a version no. Now I need to show _T("N/A") in case of there is any garbage.

My solution is to check for a Valid char or integer. If found its correct else Garbage.

Any other way?