Re: g++ doesn't find the right ctor

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

 



Hi!

On Friday 11 September 2009 23:31:07 Kalle Olavi Niemitalo wrote:
> int main()
> {
>     B b;
>     float* B::*p = &B::f;
>     const float* B::*q = p; /* luckily not allowed */
>     b.*q = &c; /* modifies b.f */
>     *b.f = 1; /* tries to modify c, raises SIGSEGV */
> }
>
> which perhaps is less likely than inadvertently dereferencing a
> pointer that points to freed memory, but still.

Thank you very much for that example. Now I understand it! :)

Regards,
	Matthias

[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