Depends how you determine whether something is a string or a number, often it's done simply by looking at the first character.
Code:
if (test_str[0]>='0' && test_str[0]<='9') // and maybe check for +, -, . and other number chars
{
  // it's a number
}
else
{
  // it's a string
}
Using exception handling doesn't get you away from the above structure:
Code:
try {
if (test_str[0]>='0' && test_str[0]<='9') // and maybe check for +, -, . and other number chars
{
  throw "it's a number";
}
else
{
  throw "it's a string";
}
} catch (char *ex)
{
 // what are you going to do here?  Compare the string and set a flag?
}
As you can see it's spectacularly inefficient to do it this way, because you've already determined whether it's a character or a string when you decide which exception to throw.

Another possibility is to call atoi or something similar, and if that returns an error, throw an exception, but even then when you've got the error you know that the test string contains something that isn't a number (and is presumably a string).

What exactly are you trying to do? Taken exactly as written the question makes no sense; try/catch is an exception handling mechanism, it does no testing for whether something is a number or a string or any other processing; if an exception is thrown in a try block, it is picked up by the catch block, and that's all.

If you've got your own atoi equivalent that throws exceptions if the number isn't converted then the question could make sense:
Code:
try {
  num=my_atoi(test_str);
  itsanum=1; itsastr=0;  // if it worked, this is valid, if not then we got an exception
} catch (my_atoi_ex)
{
  // maybe check what the exception is, the failure could be down to a number of reasons
  if (my_atoi_ex.FailedBecauseItsAString)
  {
    itsanum=0; itsastr=1;
  }
}