Hi,
Can someone give me an explanation why the following code produces a
bug. I think it's related to the compiler and that the first line is
not OK. I have no pb with gcc 3.4 but the bug appeared with gcc 4.1.1
A* p = ...;
int l;
(char*&)p += l;
The right way is
p = reinterpret_cast<A*>(reinterpret_cast<char*>(p) + l);
Thanks
Fred

_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to