Microsoft Visual C++ 6.0 中 带参数的main函数 如何运行

来源:百度知道 编辑:UC知道 时间:2024/05/26 14:19:54
在运行时 main函数要加载 两个文件
不知道如何配置
请高手指教

运行方法:
(假设你的程序为Untitled1.exe)
打开命令提示符:
转到你的Untitled1.exe的目录,
输入下列命令:
Untitled1.exe a basdfsa 1314324 -k -f
回车就可以运行了。

这时,在Main函数里定义的
int main(int argc, char *args[])
里的argc = 6,就是表示有六个参数,
对应的
args[0] = "Untitled1.exe";
args[1] = "a";
args[2] = "basdfsa";
args[3] = "1314324";
args[4] = "-k";
args[5] = "-f";

就是这样子了。

期待高手回答~