Need a project done?

C++ Programming Developer

Search This Blog

Basic program Classes C++

Basic program Classes C++.

#include <iostream>
using namespace std;

class a{
public:
void set(int x){num = x;}
int get(){return num;}
private:
int num;
};

int main(){
a b;
b.set(45);
cout << b.get();
return 0;
}

No comments:

Post a Comment

"Don't let anyone ever make you feel like you don't deserve what you want."