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.
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