Cagliostro
Programmer
I've found a very interesting thing in Microsoft C++:
#include<iosrteam>
using namespace std;
class x
{
int xx;
int yy[10];
public:
__declspec(property(get=getA,put=setA)) int A;
__declspec(property(get=getB,put=setB)) int B[];
x():xx(0){}
int getB(long i){return yy;}
void setB(long i,int j){yy=j;}
int getA(){return xx;}
void setA(int _xx){xx=_xx;}
};
int main()
{
x t;
t.A=10;
cout<<t.A<<endl;
for(int i=0;i<10;i++)
{
t.B=i;
cout<<t.B<<endl;
}
return 0;
}
Look at the __declspecs
I think is a very nice and useful feature of MicrosoftC++. It is introduced first time in VisualC++5. John Fill
ivfmd@mail.md
#include<iosrteam>
using namespace std;
class x
{
int xx;
int yy[10];
public:
__declspec(property(get=getA,put=setA)) int A;
__declspec(property(get=getB,put=setB)) int B[];
x():xx(0){}
int getB(long i){return yy;}
void setB(long i,int j){yy=j;}
int getA(){return xx;}
void setA(int _xx){xx=_xx;}
};
int main()
{
x t;
t.A=10;
cout<<t.A<<endl;
for(int i=0;i<10;i++)
{
t.B=i;
cout<<t.B<<endl;
}
return 0;
}
Look at the __declspecs
I think is a very nice and useful feature of MicrosoftC++. It is introduced first time in VisualC++5. John Fill
ivfmd@mail.md