Array functions=compound data or not?

0 views
Skip to first unread message

Harrison

unread,
Dec 3, 2011, 1:27:45 PM12/3/11
to byu-cs-jm-142-Fall-2011
Jay,

Will pretty much all of our functions that modify arrays require
another argument that tells us how long it is?

And if so, should we just make a compound data structure that includes
an array and a length value? Or do we just require the length for
every function?

-Harrison

Jay McCarthy

unread,
Dec 3, 2011, 1:32:11 PM12/3/11
to byu-cs-jm-1...@googlegroups.com
On Sat, Dec 3, 2011 at 11:27 AM, Harrison <mcculloug...@gmail.com> wrote:
Jay,

Will pretty much all of our functions that modify arrays require
another argument that tells us how long it is?

Yes, array functions in general are useless without knowing how long the array is
 

And if so, should we just make a compound data structure that includes
an array and a length value? Or do we just require the length for
every function?

It's up to you. I would practice doing both.

Jay
 

-Harrison



--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93
Reply all
Reply to author
Forward
0 new messages