Back To C++ Classes
//program to demonstrate example of a class containing static data members and static member functions #include
#include
class student { int rollno; char name[20]; int marks; int clas; static int count; public: student() { count++; } void getdata() { cout<<"enter rollno of the student "; cin>>rollno; cout<<"\nenter name of the student "; cin>>name; cout<<"\nenter marks of the student "; cin>>marks; cout<<"\nenter class of the student "; cin>>clas; } void showdata() { cout<<"\nrollno of the student is "<