首页 > 代码库 > C代码程序功能开发用keil编程

C代码程序功能开发用keil编程

C语言编写的程序中也可以实现,灵活地运用命令行参数效地程序的运行效率,收到事倍的效果。C语言中有命令行参数涉及到程序的主函数main(int argc,char *argv[]这样两个参数,其中,int argc表示命令行参数的个数(包括可执行程序名本身),char *每个参数的具体内容,argv[0]为命令行执行程序名本身,[1]为命令行中第二个参数的内容,依次类推。如下例输出命令行参数的个数及参数的内容:
main (int argc,char *argv[],I=0;while(argc>=1)
命令行参数用的最多还是在诸如DIR A:等之类带有盘符、路径或件名令行中,所以说灵活处理这一类参数才能有效地提高程序的运行效果。譬如DIR命令,其后可以是盘符,可以是路径,也可以是文件名,如何区一参数呢?请看下例(此模拟DIR命令,程序要求在命令行输入一个参数:盘符或路径或文件名或参数多于一个都将取默认的参数“*.*”)。
\*--------------------
功能:模拟DIR命令进行处理命令行参数
--------------------*/#include#include#include#incdeint j,num=0;char ss[20],path[50],path2[50];
void main (int argc,char *argv[])
{struct ffblk f;int done;if(argc==2)  /*取命令行参数到数组中*/stcpy(ss,argv[1]);elsestrcpy(ss,″*.*″); /*给数组赋省参数*/if (((ss[strlen(ss)-1]==′\\′||((ss[strlen(ss)-1]==‘:‘))strcat(ss,″*.*″); /*若参数为路径或盘符,则加上″*.*″ */getcwd(pat1,50); /*取当前径*/if (chdir(ss)==0) /*判断参数是路径*/strcat(ss,\\*.*); /*若路径末没有带\,则加上*.* */chdir(path1); /*恢复原来路径*/

 

 

www.qidian.com/BookReader/3288385,62656002.aspx
www.qidian.com/BookReader/3288385,62656046.aspx
www.qidian.com/BookReader/3288385,62656134.aspx
www.qidian.com/BookReader/3288385,62656192.aspx
www.qidian.com/BookReader/3288385,62656239.aspx
www.qidian.com/BookReader/3288385,62656268.aspx
www.qidian.com/BookReader/3288385,62656304.aspx
www.qidian.com/BookReader/3288385,62656344.aspx
www.qidian.com/BookReader/3288385,62656395.aspx
www.qidian.com/BookReader/3288385,62656460.aspx
www.qidian.com/BookReader/3288385,62656691.aspx
www.qidian.com/BookReader/3288385,62656747.aspx
www.qidian.com/BookReader/3288385,62656790.aspx
www.qidian.com/BookReader/3288385,62657292.aspx
www.qidian.com/BookReader/3288385,62657317.aspx
www.qidian.com/BookReader/3288385,62657375.aspx
www.qidian.com/BookReader/3288385,62657583.aspx
www.qidian.com/BookReader/3288385,62657637.aspx
www.qidian.com/BookReader/3288385,62657722.aspx
www.qidian.com/BookReader/3288385,62657767.aspx
www.qidian.com/BookReader/3288385,62657820.aspx
www.qidian.com/BookReader/3288385,62657868.aspx
www.qidian.com/BookReader/3288385,62657903.aspx
www.qidian.com/BookReader/3288385,62657966.aspx
www.qidian.com/BookReader/3288385,62658025.aspx
www.qidian.com/BookReader/3288385,62658073.aspx
www.qidian.com/BookReader/3288385,62658101.aspx
www.qidian.com/BookReader/3288385,62658132.aspx
www.qidian.com/BookReader/3288385,62658175.aspx
www.qidian.com/BookReader/3288385,62658207.aspx
www.qidian.com/BookReader/3288385,62658250.aspx
www.qidian.com/BookReader/3288385,62658272.aspx
www.qidian.com/BookReader/3288385,62658300.aspx
www.qidian.com/BookReader/3288385,62658326.aspx
www.qidian.com/BookReader/3288385,62658346.aspx
www.qidian.com/BookReader/3288385,62658379.aspx
www.qidian.com/BookReader/3288385,62658417.aspx
www.qidian.com/BookReader/3288385,62658453.aspx
www.qidian.com/BookReader/3288385,62658480.aspx
www.qidian.com/BookReader/3288385,62658510.aspx
www.qidian.com/BookReader/3288385,62658536.aspx
www.qidian.com/BookReader/3288385,62658565.aspx
www.qidian.com/BookReader/3288385,62658602.aspx
www.qidian.com/BookReader/3288385,62658627.aspx
www.qidian.com/BookReader/3288385,62658664.aspx
www.qidian.com/BookReader/3288385,62658710.aspx
www.qidian.com/BookReader/3288385,62658748.aspx
www.qidian.com/BookReader/3288385,62658772.aspx
www.qidian.com/BookReader/3288385,62658816.aspx
www.qidian.com/BookReader/3288385,62658901.aspx
www.qidian.com/BookReader/3288385,62658933.aspx
www.qidian.com/BookReader/3288385,62658968.aspx
www.qidian.com/BookReader/3288385,62659018.aspx
www.qidian.com/BookReader/3288385,62659036.aspx
www.qidian.com/BookReader/3288385,62659074.aspx
www.qidian.com/BookReader/3288385,62659104.aspx
www.qidian.com/BookReader/3288385,62659124.aspx
www.qidian.com/BookReader/3288385,62659191.aspx
www.qidian.com/BookReader/3288385,62659236.aspx
www.qidian.com/BookReader/3288385,62659301.aspx
www.qidian.com/BookReader/3288385,62659338.aspx
www.qidian.com/BookReader/3288385,62659362.aspx
www.qidian.com/BookReader/3288385,62659437.aspx
www.qidian.com/BookReader/3288385,62659484.aspx
www.qidian.com/BookReader/3288385,62659558.aspx
www.qidian.com/BookReader/3288385,62659618.aspx
www.qidian.com/BookReader/3288385,62659660.aspx
www.qidian.com/BookReader/3288385,62659687.aspx
www.qidian.com/BookReader/3288385,62659714.aspx
www.qidian.com/BookReader/3288385,62660892.aspx
www.qidian.com/BookReader/3288385,62660900.aspx
www.qidian.com/BookReader/3288385,62660928.aspx
www.qidian.com/BookReader/3288385,62660944.aspx
www.qidian.com/BookReader/3288385,62660957.aspx
www.qidian.com/BookReader/3288385,62660967.aspx
www.qidian.com/BookReader/3288385,62660988.aspx
www.qidian.com/BookReader/3288385,62661005.aspx
www.qidian.com/BookReader/3288385,62661025.aspx
www.qidian.com/BookReader/3288385,62661050.aspx
www.qidian.com/BookReader/3288385,62661071.aspx
www.qidian.com/BookReader/3288385,62661086.aspx
www.qidian.com/BookReader/3288385,62661105.aspx
www.qidian.com/BookReader/3288385,62661122.aspx
www.qidian.com/BookReader/3288385,62661132.aspx
www.qidian.com/BookReader/3288385,62665474.aspx
www.qidian.com/BookReader/3288385,62665500.aspx
www.qidian.com/BookReader/3288385,62665531.aspx
www.qidian.com/BookReader/3288385,62665569.aspx
www.qidian.com/BookReader/3288385,62665583.aspx
www.qidian.com/BookReader/3288385,62665632.aspx
www.qidian.com/BookReader/3288385,62665671.aspx
www.qidian.com/BookReader/3288385,62665761.aspx
www.qidian.com/BookReader/3288385,62665858.aspx
www.qidian.com/BookReader/3288385,62665882.aspx
www.qidian.com/BookReader/3288385,62665925.aspx
www.qidian.com/BookReader/3288385,62665986.aspx
www.qidian.com/BookReader/3288385,62666057.aspx
www.qidian.com/BookReader/3288385,62666108.aspx
www.qidian.com/BookReader/3288385,62666120.aspx
www.qidian.com/BookReader/3288385,62666130.aspx
www.qidian.com/BookReader/3288385,62666147.aspx
www.qidian.com/BookReader/3288385,62666160.aspx
www.qidian.com/BookReader/3288385,62666176.aspx
www.qidian.com/BookReader/3288385,62666197.aspx
www.qidian.com/BookReader/3288385,62666233.aspx
www.qidian.com/BookReader/3288385,62666408.aspx
www.qidian.com/BookReader/3288385,62666425.aspx
www.qidian.com/BookReader/3288385,62666469.aspx
www.qidian.com/BookReader/3288385,62666509.aspx
www.qidian.com/BookReader/3288385,62666526.aspx
www.qidian.com/BookReader/3288385,62666546.aspx
www.qidian.com/BookReader/3288385,62666561.aspx
www.qidian.com/BookReader/3288385,62666585.aspx
www.qidian.com/BookReader/3288385,62666692.aspx
www.qidian.com/BookReader/3288385,62666798.aspx
www.qidian.com/BookReader/3288385,62666871.aspx
www.qidian.com/BookReader/3288385,62666923.aspx
www.qidian.com/BookReader/3288385,62666991.aspx
www.qidian.com/BookReader/3288385,62667045.aspx
www.qidian.com/BookReader/3288385,62667090.aspx
www.qidian.com/BookReader/3288385,62667113.aspx
www.qidian.com/BookReader/3288385,62667168.aspx
www.qidian.com/BookReader/3288385,62667212.aspx
www.qidian.com/BookReader/3288385,62667244.aspx
www.qidian.com/BookReader/3288385,62667292.aspx
www.qidian.com/BookReader/3288385,62667313.aspx
www.qidian.com/BookReader/3288385,62667348.aspx
www.qidian.com/BookReader/3288385,62667459.aspx
www.qidian.com/BookReader/3288385,62667522.aspx
www.qidian.com/BookReader/3288385,62667538.aspx
www.qidian.com/BookReader/3288385,62667583.aspx
www.qidian.com/BookReader/3288385,62667618.aspx
www.qidian.com/BookReader/3288385,62667672.aspx
www.qidian.com/BookReader/3288385,62667697.aspx
www.qidian.com/BookReader/3288385,62667750.aspx
www.qidian.com/BookReader/3288385,62667813.aspx
www.qidian.com/BookReader/3288385,62667876.aspx
www.qidian.com/BookReader/3288385,62667918.aspx
www.qidian.com/BookReader/3288385,62667956.aspx
www.qidian.com/BookReader/3288385,62667982.aspx
www.qidian.com/BookReader/3288385,62667996.aspx
www.qidian.com/BookReader/3288385,62668016.aspx
www.qidian.com/BookReader/3288385,62668076.aspx
www.qidian.com/BookReader/3288385,62668140.aspx
www.qidian.com/BookReader/3288385,62668200.aspx
www.qidian.com/BookReader/3288385,62669157.aspx
www.qidian.com/BookReader/3288385,62669306.aspx
www.qidian.com/BookReader/3288385,62669546.aspx
www.qidian.com/BookReader/3288385,62669873.aspx
www.qidian.com/BookReader/3288385,62670087.aspx
www.qidian.com/BookReader/3288385,62670092.aspx
www.qidian.com/BookReader/3288385,62670096.aspx
www.qidian.com/BookReader/3288385,62670104.aspx
www.qidian.com/BookReader/3288385,62670401.aspx
www.qidian.com/BookReader/3288385,62671547.aspx
www.qidian.com/BookReader/3288385,62671659.aspx
www.qidian.com/BookReader/3288385,62671664.aspx
www.qidian.com/BookReader/3288385,62674376.aspx
www.qidian.com/BookReader/3288385,62674380.aspx
www.qidian.com/BookReader/3288385,62674393.aspx
www.qidian.com/BookReader/3288385,62674401.aspx
www.qidian.com/BookReader/3288385,62674516.aspx
www.qidian.com/BookReader/3288385,62674526.aspx
www.qidian.com/BookReader/3288385,62674528.aspx
www.qidian.com/BookReader/3288385,62674611.aspx
www.qidian.com/BookReader/3288385,62674620.aspx
www.qidian.com/BookReader/3288385,62674690.aspx
www.qidian.com/BookReader/3288385,62674697.aspx
www.qidian.com/BookReader/3288385,62675002.aspx
www.qidian.com/BookReader/3288385,62675012.aspx
www.qidian.com/BookReader/3288385,62675039.aspx
www.qidian.com/BookReader/3288385,62675223.aspx
www.qidian.com/BookReader/3288385,62675226.aspx
www.qidian.com/BookReader/3288385,62675231.aspx
www.qidian.com/BookReader/3288385,62675234.aspx
www.qidian.com/BookReader/3288385,62675381.aspx
www.qidian.com/BookReader/3288385,62675403.aspx
www.qidian.com/BookReader/3288385,62675507.aspx
www.qidian.com/BookReader/3288385,62675703.aspx
www.qidian.com/BookReader/3288385,62675708.aspx
www.qidian.com/BookReader/3288385,62675752.aspx
www.qidian.com/BookReader/3288385,62675843.aspx
www.qidian.com/BookReader/3288385,62675856.aspx
www.qidian.com/BookReader/3288385,62675870.aspx
www.qidian.com/BookReader/3288385,62675874.aspx
www.qidian.com/BookReader/3288385,62675882.aspx
www.qidian.com/BookReader/3288385,62675925.aspx
www.qidian.com/BookReader/3288385,62675940.aspx
www.qidian.com/BookReader/3288385,62675981.aspx
www.qidian.com/BookReader/3288385,62675998.aspx
www.qidian.com/BookReader/3288385,62676004.aspx
www.qidian.com/BookReader/3288385,62676011.aspx
www.qidian.com/BookReader/3288385,62676044.aspx
www.qidian.com/BookReader/3288385,62676056.aspx
www.qidian.com/BookReader/3288385,62676071.aspx
www.qidian.com/BookReader/3288385,62676078.aspx
www.qidian.com/BookReader/3288385,62676088.aspx
www.qidian.com/BookReader/3288385,62676106.aspx
www.qidian.com/BookReader/3288385,62676194.aspx
www.qidian.com/BookReader/3288385,62676238.aspx
www.qidian.com/BookReader/3288385,62676293.aspx
www.qidian.com/BookReader/3288385,62676380.aspx
www.qidian.com/BookReader/3288385,62676503.aspx
www.qidian.com/BookReader/3288385,62676518.aspx
www.qidian.com/BookReader/3288385,62676527.aspx
www.qidian.com/BookReader/3288385,62676537.aspx
www.qidian.com/BookReader/3288385,62676638.aspx
www.qidian.com/BookReader/3288385,62676672.aspx
www.qidian.com/BookReader/3288385,62676691.aspx
www.qidian.com/BookReader/3288385,62676707.aspx
www.qidian.com/BookReader/3288385,62676843.aspx
www.qidian.com/BookReader/3288385,62676855.aspx
www.qidian.com/BookReader/3288385,62677197.aspx
www.qidian.com/BookReader/3288385,62677254.aspx
www.qidian.com/BookReader/3288385,62677269.aspx
www.qidian.com/BookReader/3288385,62677346.aspx
www.qidian.com/BookReader/3288385,62677451.aspx
www.qidian.com/BookReader/3288385,62677464.aspx
www.qidian.com/BookReader/3288385,62677480.aspx
www.qidian.com/BookReader/3288385,62677488.aspx
www.qidian.com/BookReader/3288385,62677522.aspx
www.qidian.com/BookReader/3288385,62677551.aspx
www.qidian.com/BookReader/3288385,62677569.aspx
www.qidian.com/BookReader/3288385,62677623.aspx
www.qidian.com/BookReader/3288385,62677674.aspx
www.qidian.com/BookReader/3288385,62677677.aspx
www.qidian.com/BookReader/3288385,62677694.aspx
www.qidian.com/BookReader/3288385,62677700.aspx
www.qidian.com/BookReader/3288385,62677708.aspx
www.qidian.com/BookReader/3288385,62677716.aspx
www.qidian.com/BookReader/3288385,62677818.aspx
www.qidian.com/BookReader/3288385,62677908.aspx
www.qidian.com/BookReader/3288385,62678027.aspx
www.qidian.com/BookReader/3288385,62678219.aspx
www.qidian.com/BookReader/3288385,62678249.aspx
www.qidian.com/BookReader/3288385,62678279.aspx
www.qidian.com/BookReader/3288385,62678318.aspx
www.qidian.com/BookReader/3288385,62678530.aspx
www.qidian.com/BookReader/3288385,62678618.aspx
www.qidian.com/BookReader/3288385,62678793.aspx
www.qidian.com/BookReader/3288385,62383610.aspx

 

C代码程序功能开发用keil编程