Sign-up....

如何通过命令行的形式向应用程序中传值?谢谢!

如: demo.exe -d "dfsdf" , 将子串"dfsdf"传入程序中

[43 byte] By [msdn] at [2007-9-26 8:20:35]
# 1 Re: 如何通过命令行的形式向应用程序中传值?谢谢!

什么 意思?

qrlvls at 2005-5-20 16:21:57 >
# 2 Re: 如何通过命令行的形式向应用程序中传值?谢谢!

int main(int argc, char *argv[])

argc是个数(包括文件名本身),argv是参数(包括文件名本身)

demo.exe -d "dfsdf"就是:

argc=3,argv[0]=demo.exe,argv[1]=-d,argv[2]="dfsdf"

lw1a2 at 2005-5-20 16:41:37 >
# 3 Re: 如何通过命令行的形式向应用程序中传值?谢谢!

thanks

hb_wxy at 2005-5-20 18:41:40 >

C/C++

All Classified