| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 950 人关注过本帖
标题:关于主函数main()的参数传递问题!急!
取消只看楼主 加入收藏
dahai0464
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-9-23
收藏
 问题点数:0 回复次数:0 
关于主函数main()的参数传递问题!急!
现在在看一个程序,涉及到了主函数的参数传递问题,以前一直没有注意这个问题,问题如下:
int main(int argc, char *argv[])或int main(int argc, char **argv)
在程序中用到了这两个参数,如if (argc<2) {...} Cparam.ReadParameterFile(argv[1])等,
我看了些资料,如:
argc:An integer that contains the count of arguments that follow in argv. The argc parameter is always greater than or equal to1.
argv: An array of null-terminated strings repressenting command-line arguments entered by the user of the program. By convention , argv[0] is the command with which the program is invoked , argv[1] is the first command-line argument, and so on, until argv[argc], which is always NULL..............
但是,具体的,到底这两个参数的低层传递过程是怎么完成的,传递的是什么数据
(有的资料上说是传递命令行相关参数,但是我看的程序里只有一个参数文件,根本没有用到命令行!!)
真诚希望高手门不吝赐教,小弟将不胜感激!!!
搜索更多相关主题的帖子: 主函数 main 参数 argc argv 
2006-09-23 09:52
快速回复:关于主函数main()的参数传递问题!急!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015718 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved