#include "stdio.h" #include "windows.h" #include <iostream> using namespace std; int main(int argc, char *argv[]) { FILE* fp; fp = fopen("D:\\canshuout.txt", "w"); if(fp == NULL) { cout << "无法打开文件." << endl; return -1; } cout << "参数如下" << endl; for (int i = 0; i < argc; i++) { fputs(argv[i], fp); fputs("\n", fp); // 在每个参数后添加新行。 cout << argv[i] << endl; } fclose(fp); cout << "调用参数完毕参数" << endl; getchar(); return 0; }
您需要 登录 才可以下载或查看,没有账号?register
举报
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|雪舞知识库 ( 浙ICP备15015590号-1 | 萌ICP备20232229号|浙公网安备33048102000118号 )|天天打卡
GMT+8, 2026-7-14 13:41 , Processed in 0.084770 second(s), 31 queries .
Powered by Discuz! X5.0
© 2001-2026 Discuz! Team.