C ++没有匹配函数用于call system(); [英] C++ no matching function for call system();

查看:94
本文介绍了C ++没有匹配函数用于call system();的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include< iostream>

#include< stdlib.h>





使用命名空间std ;



int输入;

char java;

char out;



void p()

{

cout<< 请输入档案:;

cin>> java;

cout<< \ n请输入文件:;

cin>> out;

cout<< \ n请等待......;

system(javac,java);

system(jar cvf,out,。/ *。class );

cout<< 完成;

}

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





cout<< 1.编译为.jar \\\
2.Compile到类\\\
3.Exit \ nInput:;

cin>>输入;

if(输入== 1){

p();

}否则if(input == 2){



}否则如果(输入== 3){

退出;

}否则如果(输入){

cout<< 呃;

}



}



什么我试过了:



求助!这是什么? PS它是编译java的帮助器

解决方案

请参阅文档: system,_wsystem [ ^ ]。


系统函数只接受一个参数,a C -like string。

请参阅 system - C ++参考 [ ^ ]。

#include<iostream>
#include<stdlib.h>


using namespace std;

int input;
char java;
char out;

void p()
{
cout << "Please enter in file: ";
cin >> java;
cout << "\nPlease enter out file: ";
cin >> out;
cout << "\nPlease wait...";
system("javac ", java);
system("jar cvf ", out, "./*.class");
cout << "Done";
}
int main( int argc, char* argv[] ) {


cout << "1. Compile to .jar \n2.Compile to class \n3.Exit \nInput: ";
cin >> input;
if (input==1) {
p();
} else if (input==2) {

} else if (input==3) {
exit;
} else if (input) {
cout << "Err";
}

}

What I have tried:

Help please ! What is this? P.S its a helper for compile java

解决方案

See the documentation: system, _wsystem[^].


the system function takes just a single argument, a C-like string.
See system - C++ Reference[^].


这篇关于C ++没有匹配函数用于call system();的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆