Re: like to know why it is segmentation fault on simple throw-exception program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux