比如我在void fight()中想操作main函数的一个对象,该怎么操作啊?class A {public:int hp;};int fight() {duixiang.hp=1;//这里报错return 0;}int main() {A duixiang;return 0;}
会啦,谢谢鸭