Program to illustrate static members in class

#include <iostream.h>
#include<conio.h>
class test
{
    int code;
    static int count;    // static member variable
    public :
    void setcode (void)
    {
        code = ++count;
    }
    void showcode (void)
    {
        cout << "Object number : " << code << "\n";
    }
    static void showcount(void)        // static number function
    {
        cout << "Count : "<<count<<"\n";
    }
};
    int test :: count;
    int main()
    {
        test t1, t2;
        clrscr();
        t1.setcode();
        t2.setcode();

        test :: showcount();    // accessing static function

        test t3;
        t3.setcode ( );

        test :: showcount();

        t1.showcode();
        t2.showcode();
        t3.showcode();
        getch();
    }

10 comments:

Anonymous said...

telefonsex
Everything is very open with a clear explanation of
the issues. It was really informative. Your site is useful.
Thanks for sharing! telefon sex

My blog post blog

Anonymous said...

Ahaa, its good discussion concerning this piece
of writing at this place at this weblog, I have read all that, so at this time me also commenting here.



Look into my site :: Criminal Case Cheats

Unknown said...

Hello you have done so nice work. Well and responsive blog thank you dear admin well designed Keep it up thank you
Regards:
windows 10 loader

Unknown said...


http://codeprecisely.blogspot.in//2011/11/program-to-illustrate-static-members-in.html

Anonymous said...

Parallels Desktop 11 Crack

Emrullah44 said...

Balıkesir
Bursa
Mersin
Konya
Van

HZE

Burcu2 said...

Kırşehir Lojistik
Hakkari Lojistik
Kars Lojistik
Konya Lojistik
Kilis Lojistik
13JZ

9E35BWayne4DAF5 said...

E5F6E
Sivas Evden Eve Nakliyat
Iğdır Evden Eve Nakliyat
Samsun Evden Eve Nakliyat
Edirne Evden Eve Nakliyat
Isparta Evden Eve Nakliyat

81A1DMeganC8269 said...

98F21
kütahya sesli görüntülü sohbet
yozgat ücretsiz sohbet uygulaması
gümüşhane mobil sohbet siteleri
samsun sesli görüntülü sohbet
adıyaman muhabbet sohbet
antalya rastgele görüntülü sohbet ücretsiz
canli sohbet bedava
karabük kadınlarla görüntülü sohbet
bartın sohbet sitesi

DFF61LauraDD5D3 said...

0815D
solflare
poocoin
defillama
dcent
onekey
eigenlayer
satoshi
yearn
ledger desktop

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|