Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!udel!cis.udel.edu From: carroll@cis.udel.edu (Mark Carroll) Newsgroups: comp.lang.c++ Subject: Member function static variables Message-ID: <33059@nigel.ee.udel.edu> Date: 11 Oct 90 01:33:29 GMT Sender: usenet@ee.udel.edu Organization: University of Delaware Lines: 29 Nntp-Posting-Host: sol.cis.udel.edu Originator: carroll@cis.udel.edu I've got a question concerning the status of static variables of member functions. Does the function allocate one instance of the static for each member of the class, or does it only allocate one instance of the static? Here's what I mean: class A { public: int a();; }; int A::a() { static int k; k++; cout << k; } main() { A b; A c; b.a(); c.a(); } What will this print out? 11, or 12?