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

Re: widget array




> however, there are more pressing matters to attend to - u have
> >  *((GtkWidget **)widgetPtr +1)
> this is a core dump waiting to happen. on 32 bit machines pointers are 4 bytes
> so
> it should be + 4; it is much easier (and safer/portable) to do +
> sizeof(widgetPtr) - which
> should give u the pointer size in bytes.

pointer arithmetic causes widgetPtr + 1 to be the same as &widgetPtr[1].
using widgetPtr + sizeof(widgetPtr) is not what the person wants, they
want the address of the next element in the array, in which case +1 is
correct.



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