That's what I meant by using a marker.

RobR 


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of benjamin_cail_scott
Sent: Wednesday, September 01, 2010 11:06 AM
To: [email protected]
Subject: [c-prog] Re: Can a function return an array of 4 pointers?

You can also have an unbroken array: That is no nulls until you reach
the end of the array.  You will have to enforce that through programming
however.

--- In [email protected], "Rob Richardson" <rob.richard...@...>
wrote:
>
> But you need some way to know how big the array is: some marker, like 
> 0 at the end of a string, or a count of the number of elements in the 
> array, which would mean you'd return a structure (or class) that looks

> something like this:
> 
> struct CountedArray
> {
>       int numberOfElements
>       MyType* pStartOfElements;
> }
> 
> Or you need some guarantee that the function will only return 
> four-element arrays.
> 
> RobR
>




------------------------------------

To unsubscribe, send a blank message to
<mailto:[email protected]>.Yahoo! Groups Links



Reply via email to