Re: [Dev-C++] Static in member function
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2003-09-16 19:48:59
|
They would share the same variable.
/Per W
On Tue, 16 Sep 2003, Bjorn Terelius wrote:
> If a static variable is declared inside a member function of a class, what
> would happen?
> That is, would all instances of the class use the same value, or would each
> instance have its own copy of the variable?
>
>
> The function is defined something like this:
>
> int Array::unshift() // unshift
> {
> static int *active=first;
>
> // the function is supposed to return the i:th element on the i:th call
>
> }
>
>
> Thanks for any help
> Bjorn Terelius
>
> _________________________________________________________________
> Protect your PC - get McAfee.com VirusScan Online
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|