Re: Is it possible to modify shared struct array in a function.

2019-02-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, February 8, 2019 4:27:44 AM MST Eduard Staniloiu via Digitalmars- d-learn wrote: > On Friday, 8 February 2019 at 06:55:15 UTC, Jerry wrote: > > On Friday, 8 February 2019 at 04:51:08 UTC, Sudhi wrote: > >> On Friday, 8 February 2019 at 04:30:23 UTC, Arun > >> > >> Chandrasekaran wrote: >

Re: Is it possible to modify shared struct array in a function.

2019-02-08 Thread Eduard Staniloiu via Digitalmars-d-learn
On Friday, 8 February 2019 at 06:55:15 UTC, Jerry wrote: On Friday, 8 February 2019 at 04:51:08 UTC, Sudhi wrote: On Friday, 8 February 2019 at 04:30:23 UTC, Arun Chandrasekaran wrote: On Friday, 8 February 2019 at 04:13:39 UTC, Sudhi wrote: [...] Works fine for me with DMD64 D Compiler v2.0

Re: Is it possible to modify shared struct array in a function.

2019-02-07 Thread Jerry via Digitalmars-d-learn
On Friday, 8 February 2019 at 04:51:08 UTC, Sudhi wrote: On Friday, 8 February 2019 at 04:30:23 UTC, Arun Chandrasekaran wrote: On Friday, 8 February 2019 at 04:13:39 UTC, Sudhi wrote: [...] Works fine for me with DMD64 D Compiler v2.083.1. https://run.dlang.io/is/RRM8GU My example code w

Re: Is it possible to modify shared struct array in a function.

2019-02-07 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Friday, 8 February 2019 at 04:51:08 UTC, Sudhi wrote: On Friday, 8 February 2019 at 04:30:23 UTC, Arun Chandrasekaran wrote: [...] My example code was wrong. Below is the right one. struct Company { string name; string location; } struct Racks { int number; int location;

Re: Is it possible to modify shared struct array in a function.

2019-02-07 Thread Sudhi via Digitalmars-d-learn
On Friday, 8 February 2019 at 04:30:23 UTC, Arun Chandrasekaran wrote: On Friday, 8 February 2019 at 04:13:39 UTC, Sudhi wrote: I have a situation, where i want to modify a shared variable in a function. Something like below struct Company { string name; string location; } struct Rack

Re: Is it possible to modify shared struct array in a function.

2019-02-07 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Friday, 8 February 2019 at 04:13:39 UTC, Sudhi wrote: I have a situation, where i want to modify a shared variable in a function. Something like below struct Company { string name; string location; } struct Racks { int number; int location; } struct Metadata { string na

Is it possible to modify shared struct array in a function.

2019-02-07 Thread Sudhi via Digitalmars-d-learn
I have a situation, where i want to modify a shared variable in a function. Something like below struct Company { string name; string location; } struct Racks { int number; int location; } struct Metadata { string name; Company[] companies; Racks[] racks; } struct