/*
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::: THIS PROGRAMM EVALUTE THE CONCEPT OF STATIC MEMBER FUNCTION ::::
:::: AND STATIC VARIBLE IN C++ PROGRAMMING LANGUAGE ::::
:::: DEVLOPED BY DX PANCHAL AT GROW MORE M.C.A. LAB ::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
*/
// HEADER FILE DECLARATION
#include<iostream.h>
#include<conio.h>
#include<dos.h>
//CLASS TEST DECLARATION
class test
{
int code;
static int count;
public:
void setcode(int m)
{
code=m;
count++;
cout<<"\n\n\t\tVALUE OF CODE::>"<<code;
};
static void check()
{
cout<<"\n\n\t\tVALUE OF COUNT::>"<<count;
};
};
int test::count;
// END OF CLASS TEST
// MAIN FUNCTION SECTION
void main()
{
clrscr();
test t1,t2;
t1.setcode(1);
t1.setcode(1);
t2.setcode(1);
t2.setcode(1);
test::check();
getch();
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::: THIS PROGRAMM EVALUTE THE CONCEPT OF STATIC MEMBER FUNCTION ::::
:::: AND STATIC VARIBLE IN C++ PROGRAMMING LANGUAGE ::::
:::: DEVLOPED BY DX PANCHAL AT GROW MORE M.C.A. LAB ::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
*/
// HEADER FILE DECLARATION
#include<iostream.h>
#include<conio.h>
#include<dos.h>
//CLASS TEST DECLARATION
class test
{
int code;
static int count;
public:
void setcode(int m)
{
code=m;
count++;
cout<<"\n\n\t\tVALUE OF CODE::>"<<code;
};
static void check()
{
cout<<"\n\n\t\tVALUE OF COUNT::>"<<count;
};
};
int test::count;
// END OF CLASS TEST
// MAIN FUNCTION SECTION
void main()
{
clrscr();
test t1,t2;
t1.setcode(1);
t1.setcode(1);
t2.setcode(1);
t2.setcode(1);
test::check();
getch();
No comments:
Post a Comment