#include<iostream.h>
#include<conio.h>
class s
{
int b;
s(int a):b(a)
{
cout<<"value:\t"<<a+12;
}
public:
static s sp(int n)
{
return s(n);
}
};
void main()
{
clrscr();
s::sp(10);
getch();
}
private constructor , without object with static function
Reviewed by
studypoint
on
18:36
Rating:
5
No comments
Post a Comment