Pola i metody statyczne
Pola i metody statyczne
Pola i metody statyczne
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Metoda statyczna<br />
7<br />
class PrzykladKlasy { //. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .<br />
public :<br />
static int IloscObiektow;<br />
PrzykladKlasy( ) { ++ IloscObiektow; }<br />
∼ PrzykladKlasy( ) { −− IloscObiektow; }<br />
static int RozmiarObiektow( )<br />
{ return IloscObiektow∗sizeof(PrzykladKlasy); }<br />
}; // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .<br />
int PrzykladKlasy :: IloscObiektow = 0;<br />
int main( )<br />
{<br />
cout