//Skip to content
C++ Classes and Objects
- #include<iostream>
- using namespace std;
-
- class Student{
- private:
- int roll;
- string name;
- public:
- void setDetails(int a,string s);
- void getDetails(){
- cout<<"Roll: "<<roll<<endl;
- cout<<"Name: "<<name<<endl;
- }
- };
- void Student::setDetails(int a,string s){
- roll=a;
- name=s;
- }
- int main()
- {
- Student aStudent;
- aStudent.setDetails(1,"Sujan Hasan");
- aStudent.getDetails();
- return 0;
- }
I am Md Abdullah Al Hasan. I have completed my graduation in Computer Science and Engineering from Jashore University of Science and Technology.
0 Comments:
Post a Comment