Array of struct pointers error

Szymon Gatner noemail at gmail.com
Wed Feb 26 03:07:42 PST 2014


On Wednesday, 26 February 2014 at 10:59:39 UTC, bearophile wrote:
> Szymon Gatner:
>
>> I want to keep a list of pointers-to-C-struct but this line:
>
> Please reduce your code as much as possible, and show the whole 
> compilable reduced buggy program here.
>
> Bye,
> bearophile

That would be just it:

import dchip.all;

void main()
{
   cpBody* bodies[];
   auto b = cpBodyNew(0, 0);
   bodies ~= b;
}

where dchip is pulled using dub. As described earlier, wrapping 
cpBody* in another struct or Tuple works.


More information about the Digitalmars-d-learn mailing list