class ploy{void print(int);}void ploy::print(int a){outfile << a;}int main(){ofstream outfile(''result.txt'', ios::out);print(1);return 0;}大概就是这个样子,但是在print里面会说未定义标识符outfile求大佬救救