C
colin
some enumerable types like collections use Count but
but other enumerable types like arrays use length
why the difference?
Im not sure what my function is going to be passed yet,
some enumerable type such as an array or a list,
but I need to allocate space first, so I need to know
how big it is, so I need to use ICollection as a parameter type.
luckily arrays have ICollection as a base too, so why do arrays have
length as a field too? If I try to access Count of an array
such as "int[] a;" I have to cast it to ICollection first ..
do I get a different result?
I sometimes find I need to use a different
collection class and have to change Count to Length or vica versa.
Colin =^.^=
but other enumerable types like arrays use length
why the difference?
Im not sure what my function is going to be passed yet,
some enumerable type such as an array or a list,
but I need to allocate space first, so I need to know
how big it is, so I need to use ICollection as a parameter type.
luckily arrays have ICollection as a base too, so why do arrays have
length as a field too? If I try to access Count of an array
such as "int[] a;" I have to cast it to ICollection first ..
do I get a different result?
I sometimes find I need to use a different
collection class and have to change Count to Length or vica versa.
Colin =^.^=