like to know why it is segmentation fault on simple throw-exception program
Jonathan Wakely
jwakely.gcc@gmail.com
Wed Jun 1 23:56:00 GMT 2011
On 1 June 2011 23:16, Jonathan Wakely wrote:
> On 1 June 2011 23:01, eric wrote:
>> int main()
>> {
>> try {
>> push_a_lot();
>> }
>> catch (bound_err& err) {
>> std::cerr << "Error: Bounds exceeded\n";
>> std::cerr << "Reason: " << err.what << '\n';
>
> This should be err.what() not err.what
Oh sorry, ignore that. After actually reading the code I see your
exception has a what data member, I was assuming it had a what()
member function like std::exception.
More information about the Gcc-help
mailing list