看代码:
#include<iostream.h>
struct POINT
{
int x,y;
};
struct RECT
{
POINT ptLeftTop;
POINT ptRightDown;
}rc={{10,20},{40,50}};
int main()
{
cout<<rc.ptLeftTop.x<<endl;
cout<<rc.ptLeftTop.y<<endl;
cout<<rc.ptRightDown.x<<endl;
cout<<rc.ptRightDown.y<<endl;
return 0;
}
看结果: