Bloomberg LP Interview Question
0of 0 votesclass A {};
void foo()
{throw new A;
}
Which of the following catch statement is valid?
choice a:
catch (A && e)
choice b:
catch (A e)
choice c:
catch (A * e)
choice d:
catch (A ** e)
choice e:
catch (A & e)
Since new returns a pointer , so the result should be a pointer of type A.
Choice C should be correct.

c
- Anonymous on December 13, 2009 Edit | Flag Reply