In previous article Array management by value we talked about one way to grant to us access to array's items: we used a by value approach, in the sense we surely took copy of items values by dereferencing a pointer to record we defined at the top of code.
Our intention was to emphasize that a copy by value can even be made with the help of a pointer.
Pointers in that context could represent an alternative way to archive or reach the documents: instead of alphabetically (array[index]), by coordinates (for example, just like in battleship).
Result is essentially the same:
- we compile an original document and copy it to our file in archive;
- we fetch documents, then copy info through pointers, manipulate them.
In other words, we prepare a new record with all data, then we store these values into an array of records; so we pass values.
On the other side we create locally a new record, where to host all fetched data from array, with pointer's dereference. ...continue reading "Array management by pointer"