On 26/01/2019 9:52 AM, Q. Schroll wrote:
C* ptr = &[ new C(...) ][0];
C* ptr = [ new C(...) ].ptr;
Should work.
On Friday, 25 January 2019 at 20:31:29 UTC, H. S. Teoh wrote:
On Fri, Jan 25, 2019 at 08:12:33PM +, Q. Schroll via
Digitalmars-d-learn wrote:
Say I have a class C and I want a pointer to a C handle.
Note that taking the address of `C` will actually give you a
pointer to the reference, not
On Fri, Jan 25, 2019 at 08:12:33PM +, Q. Schroll via Digitalmars-d-learn
wrote:
> Say I have a class C and I want a pointer to a C handle.
>
> I tried the following pieces of syntax:
>
> C* obj = new C(); // gives me a C
> C* obj = new C*(); // gives me a C**
> C* obj = C*(); // refuse
Say I have a class C and I want a pointer to a C handle.
I tried the following pieces of syntax:
C* obj = new C(); // gives me a C
C* obj = new C*(); // gives me a C**
C* obj = C*(); // refuses to compile
Is it even possible? This sounds so newbie...
I know it's fairly simple with structs