set03_2 - Static Data Members in C+ Jan. 2000 - ENEL 409...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Jan. 2000 - ENEL 409 Dr. M. Moussavi 1 Static Data Members in C++ Static Data Members in C++
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Jan. 2000 - ENEL 409 Dr. M. Moussavi 2 Static Data Member Static Data Member A static class member acts as a global Information hiding can be still enforced A static data member is not entered into programs global name space. A data member is made static by prefixing its declaration by static keyword. A static data member is initialized outside the class definition.
Background image of page 2
Jan. 2000 - ENEL 409 Dr. M. Moussavi 3 Static Member Functions Static Member Functions A static data member can be a constant or a class object. Static data member initialization should happen in implementation part (.cpp file) A member function that accesses only a static member function of a class may also be declared as static.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Jan. 2000 - ENEL 409 Dr. M. Moussavi 4 Static Member Functions Static Member Functions A static member function does not have a “this” pointer.
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

set03_2 - Static Data Members in C+ Jan. 2000 - ENEL 409...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online