//c++ code(通过测试)
#include <iostream>
using namespace std;struct Rectangle{
Rectangle(int width, int height)
{
this->width = width;
this->height = height;
}
int width;
int height;
};
int main()
{
Rectangle *rec = new Rectangle(5,6);
cout<<rec->width<<endl;
cout<<rec->height<<endl;
return 1;
}
具体的区别这里就不说明了,直接看代码