- 直接上例子:
#include <iostream> using namespace std; int test(){ cout << "test" << endl; return 54; } int i = test(); int main(int argc, char** argv) { cout << i <<endl; return 0; }
结果:
test 54
例子很简单,不多说,自己看。
初识C++(10)之编译器在进入main函数之前还可以运行其他函数
最新推荐文章于 2024-08-02 13:18:32 发布