home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!uflorida!math.ufl.edu!maple.circa.ufl.edu!X9999BVJ
- From: x9999bvj@maple.circa.ufl.edu
- Newsgroups: comp.lang.c++
- Subject: Static vars in member functions
- Message-ID: <1992Dec13.185540.20212@math.ufl.edu>
- Date: 13 Dec 92 18:55:40 GMT
- Sender: news@math.ufl.edu
- Reply-To: X9999BVJ@oak.circa.ufl.edu
- Organization: Center for Instructional and Research Computing Activities
- Lines: 31
-
-
- When calling a function of a class with a static variable declared in it,
- what is the standardized behaviour for that variable?
-
- E.g.
-
- class Foo
- {
- public:
- void Blah( void );
- };
-
- void Foo::Blah( void )
- {
- static int i;
-
- i++;
- };
-
- void main( void )
- {
- Foo a, b;
-
- a.Blah();
- b.Blah();
- a.Blah();
- }
-
- When the second "a.Blah()" is executed, will i be 2 or 3?
-
- Brian
-