Re: Arrays in C++

Marcel <[email protected]>
Newsgroups gmane.comp.programming.cppug
Message-ID <[email protected]>
you may also try to use the vector template, it may be
easier for you instead of using an array
so you could return a reference to the vector

Marcel

--- Haroon Shafiq <[email protected]>
wrote:
> you are returning an array that is being declared in
> the called function. it is created on the function
> local stack and is destroyed as soon as the function
> returns. you could make it a global array, or create
> it in the calling function and pass its pointer as
> an argument to the called function. still if you
> want to declare it in called function, you can make
> it static so that its value is preserved even if the
> function returns.
> haroon
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Search - Find what you’re looking for faster.


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/cppug/

<*> To unsubscribe from this group, send an email to:
     [email protected]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.