这是我第一次提出问题。我是外国人,所以有点难以解释我的问题。也许我的标题也是错误的......让我们看看代码:
假设我定义了一个类:
class Test
{
public:
Test();
};
int main()
{
Test *pointer = new Test(); //what's the difference between these two ways,
Test test; //if the two ways are the same, which one is better under what
pointer = &test; //circumstance?
}
我希望你们能理解我在说什么并帮助我。