Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++ Subject: Re: Lets put it another way Date: Tue, 24 May 2011 22:27:05 +1200 Lines: 61 Message-ID: <941ffpFt2pU22@mid.individual.net> References: <940g82Ft2pU20@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net RvNxn0AJmLFryshwaNNG2ARAVGtsMogbbr1R5Fwq0t7VbP5bfN Cancel-Lock: sha1:E1Rt2/bhL206C/n4qzAZE/yS3K8= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:5402 On 05/24/11 09:20 PM, Paul wrote: > > "Ian Collins" wrote in message > news:940g82Ft2pU20@mid.individual.net... >> On 05/24/11 01:14 PM, Paul wrote: >>> Ok in connection to my previous post, lets remove the null pointer issue >>> and >>> consider this: >>> >>> #include >>> >>> typedef int (*pparr)[3]; >>> >>> int main(){ >>> pparr p1 = (pparr)new int[3]; >>> pparr p2= p1; >>> delete[] p1; >>> std::cout<< *p2<> >> UB yet again. >> >>> std::cout<< typeid(*p2).name(); >>> } >>> >>> >>> In the last 2 lines does an array type object exist, even though there is >>> no >>> array object? >> >> No. >> >>> If not what is the object that stores the address and is interpreted as >>> an >>> array type by the typeid expression? >> >> The typeid and sizeof operators do not evaluate their expression (unless >> in case of typeid the type is polymorphic). So no object is required. >> > You do not seem to understand the question. You do not appear to understand the answer. > I said ..if not what is the object that stores the address? > So what is this object? Do you know? There isn't an object. The compiler knows the type of *p2. You may as well have written #include #include typedef int (*pparr)[3]; int main(){ pparr p2; std::cout << typeid(*p2).name() << std::endl; } -- Ian Collins