
c++怎么输入命令行语句
展开全部
以VC为例。
打开VC。
新建工程
Win32 Console Application
main函数如下:
#include <stdlib.h> // 用来解释执行命令的
int main()
{
system("你的命令行语句 。。。");
// system("echo hello");
//system("copy xx.cpp xx.cpp");
//system("pause"); // 显示按任意键继续 。。。
return 0;
}
希望你懂了,也希望我理解对了~~~
打开VC。
新建工程
Win32 Console Application
main函数如下:
#include <stdlib.h> // 用来解释执行命令的
int main()
{
system("你的命令行语句 。。。");
// system("echo hello");
//system("copy xx.cpp xx.cpp");
//system("pause"); // 显示按任意键继续 。。。
return 0;
}
希望你懂了,也希望我理解对了~~~
展开全部
#include<iostream>
using namespace std;
int main(int argc,char *argv[])
{
if(argc>=2&&argc<=4)
for(int i=0;i<argc;i++)
cout<<argv[i]<<endl;
else
cout<<"输入有误"<<endl;
return 0;
}
using namespace std;
int main(int argc,char *argv[])
{
if(argc>=2&&argc<=4)
for(int i=0;i<argc;i++)
cout<<argv[i]<<endl;
else
cout<<"输入有误"<<endl;
return 0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
网上有生成exe的文件,你可以搜搜!
使用网上也会有的
把程序打包需要软件的!
使用网上也会有的
把程序打包需要软件的!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询