RE: [sv-bc] $fread on dynamic arrays

From: Chris Spear <Chris.Spear_at_.....>
Date: Wed Oct 15 2008 - 09:53:49 PDT
Gordon,

Funny, but I looked at the example and came up with the exact opposite
opinion.
If you construct an array with 20 elements, you probably want to limit
$fread to those 20 elements.

> If not supplied, the memory shall be filled with what data are
available

Just like a fixed size array, the dynamic memory is filled when the last
element is set.
Your suggestion of continually growing the memory would require
allocating and copying the array over and over as the file is read,
unless you know the file size in advance.

On the other hand, using $fread into a queue seems like it should read
the entire file, as a queue's size is very dynamic.

As for associative arrays ... no opinion.

Chris Spear 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Oct 15 09:55:50 2008

This archive was generated by hypermail 2.1.8 : Wed Oct 15 2008 - 09:56:22 PDT