Originally Posted by
TriKri
When an exception is thrown, how does the program know where to go? I mean, if the catch block catching the exception would have been in the same function, the throw would have been just like using a goto to the right catch block. But when there is no catch block in the same function, the compiler can't know which catch block that will catch the exception (if any at all), so the program has to figure it out in run time. But how does it do that? Does it store somewhere which type (an id) has been thrown, and looks for a catch block which catches that type?