Static class members

Nasza ocena:

3
Wyświetleń: 518
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Static class members - strona 1 Static class members - strona 2

Fragment notatki:

Static class members  a static class member is shared by all the class objects  static members exist even if there are no objects of the class  we may access it using the scope operator class ST { static int s; // declaration only int i; public: static int ps; // as above }; int ST::s=0, // definition ST::ps=0;  declare within class declaration, define (without the ” static ” keyword) outside of the class  define it once  libraries: place definitions in *.cpp, place the class declaration in *.h (there is no need or even possibility to use extern ST::s ) ... zobacz całą notatkę

Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz