我想在编写一个在DOS命令行下执行的类似DOS命令的程序delh.exe,例如:当输入: delh 1.txt 时,使它能直接删除磁盘中的隐藏文件1.txt.
程序如下 :
#include<stdlib>
#include<stdio.h>
int main(int atgc,char *argv[])
{
system("attrib" argv[1] "-h -s");
system("del" argv[1]);
return 0;
}
编译后程序不能达到预想的结果,不知是如何将命令行参数传递给system函数,使它能正确执行.????
程序如下 :
#include<stdlib>
#include<stdio.h>
int main(int atgc,char *argv[])
{
system("attrib" argv[1] "-h -s");
system("del" argv[1]);
return 0;
}
编译后程序不能达到预想的结果,不知是如何将命令行参数传递给system函数,使它能正确执行.????
一个专搜注册信息的链接注册信息搜索--历史是一个旋转的车轮,它的轨迹总是那样的相似回复后可见
