c++子函数中调用主函数怎么写

2025-04-30 00:48:07
推荐回答(1个)
回答1:

能的。 比如以下实例: #include void A() {}; void a() { cout>>"a">>endl; }; void b() { a();//,a函数定要先于b函数声明 } void main() { A(); a(); b(); } 运行这个程序,结果为 a a 说明a()运行了两次。