POV-Ray : Newsgroups : povray.off-topic : C/C++ Data Type Ambiguity Backwards Server Time
8 Jul 2024 08:58:34 EDT (-0400)
  C/C++ Data Type Ambiguity Backwards (Message 21 to 21 of 21)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Warp
Subject: Re: Platform with non-8-bit bytes
Date: 3 Sep 2015 05:52:19
Message: <55e81853@news.povray.org>
Orchid Win7 v1 <voi### [at] devnull> wrote:
> I saw an FAQ page somewhere that had examples of systems where the size 
> of a pointer really does change depending on what it points to.

Many C programmers assume that you can convert any pointer to void*
and back, as they assume that all pointers have the same size.

In C++ you can't always make that assumption. More precisely, a pointer
to a virtual function is (most probably) larger than a regular function
pointer. A pointer-to-virtual-function cannot be converted to void* and
back without malfunction.

-- 
                                                          - Warp


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.