Skip to main content

Example of CLASS (in C++) [1]

#include<iostream> using namespace std; class Sample { public: int a; }; int main() { Sample object; /*we used (.) operator after object to access the property of class */ cin>>object.a; cout<<"The value u entered in the property of class,after multiplied by 2 =" << object.a*2; return 0; }

Quote:

Forget all the reasons it won't work and believe the one reason that it will...