这是我最近学习c++过程中遇到的一个问题,同时也说明了自定义类的使用,这里借用别人的例子来说明一下这个问题。
View Code
1 #include "stdafx.h" 2 using namespace std; 3 4 /* --- --- --- --- --- --- --- 武器类 --- --- --- --- --- --- */ 5 class Weapon 6 { 7 private: 8 string