In this program, You will learn how to create a simple program using class and object in C++.
obj.msg();
obj.display();
#include<iostream>
using namespace std;
class Test {
public:
void msg() {
cout << "msg function is called here";
}
void display() {
cout << "\ndisplay function is called here";
}
};
int main() {
Test obj;
obj.msg();
obj.display();
return 0;
}
msg function is called here
display function is called here