21.02.2015 Views

Pola i metody statyczne

Pola i metody statyczne

Pola i metody statyczne

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Pole <strong>statyczne</strong><br />

5<br />

class PrzykladKlasy { // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .<br />

public :<br />

static int IloscObiektow;<br />

PrzykladKlasy( ) { ++ IloscObiektow; }<br />

∼ PrzykladKlasy( ) { −− IloscObiektow; }<br />

}; // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .<br />

PrzykladKlasy ObGlobalny;<br />

int PrzykladKlasy :: IloscObiektow = 0;<br />

int main( )<br />

{<br />

PrzykladKlasy Ob;<br />

}<br />

cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!