Re: [Dev-C++] "static" seems a bit confucius... :D
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2003-09-22 06:19:29
|
Declaring a static variable inside the implementation of a class method is
identical to declaring it inside a normal function, so - if I remember my
original numbering - it is my 2nd example.
I just wanted to display the different uses of static - for file-wide
variable, inside a function/method, and inside a class definition.
/Per W
On Mon, 22 Sep 2003, Oladipo Odumosu wrote:
>
> yo /Per,
>
> 4give me if i'm wrong, but i thought item 4 was for those variables which=
are *declared **in** the class* , not in functions belonging to the class.=
if my memory serves me right, the query was about
>
> class test
>
> {
>
> public:
>
> void f();
>
> }
>
>
>
> void test::f()
>
> {
>
> static int cow =3D 0;
>
> cow++; std::cout << cow << std::endl;
>
> }
>
> or something likewise. if some1 will take Confucius away, i'll gladly get=
back to my TCPL :D.
>
>
> ---------------------------------
> Want to chat instantly with your online friends?=A0Get the FREE Yahoo!Mes=
senger
|