我开始学习 C#,我发现有两种不同的方法来创建对象。首先是这样的:
Box Box1 = new Box(); // Declare Box1 of type Box
Box Box2 = new Box(); // Declare Box2 of type Box
其他是这样的:
Box Box1 ; // Declare Box1 of type Box
Box Box2 ; // Declare Box2 of type Box
两种方法都有效,有什么区别?C++指针有类似的东西吗?
Box* Box1 = new Box(); // Declare Box1 of type Box
Box* Box2 = new Box(); // Declare Box2 of type Box
眼眸繁星
相关分类