Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
函数和变量“;鸡还是蛋;脚本 我正在编写一个简单的程序,用C++运行FFMPEG,但是我需要在“Mault”中定义某些变量,但是函数需要在主函数之上,以便使用。我能做什么 #include <iostream> #include <cstdlib> using namespace std; int convert() { int operation; switch(operation){ case '1': case '2': case '3': case '4': ; } return 0; } int main() { std::string formatIn; std::string FormatOut; std::string confirm; cout << "select format that file is currently in: mp3, gp3, mp4, flv" << endl; cin >> formatIn; cout << "original format = " << formatIn << endl; cout << "choose your target format: mp3, gp3, mp4, flv" << endl; cin >> FormatOut; cout << "selected format = " << FormatOut << endl; cout << "proceed? "; cin >> confirm; if(confirm == "yes"){ cout << "proceeding with operation:" << endl; convert(); } else{ if(confirm == "no"){ cout << "canceling,,," << endl; } } } #包括 #包括 使用名称空间std; int convert() { int操作; 开关(操作){ 案例“1”: 案例“2”: 案例“3”: 案例“4”: ; } 返回0; } int main() { std::字符串格式; std::字符串格式化; std::字符串确认; 不能形成素; cout_C++_Ffmpeg - Fatal编程技术网

函数和变量“;鸡还是蛋;脚本 我正在编写一个简单的程序,用C++运行FFMPEG,但是我需要在“Mault”中定义某些变量,但是函数需要在主函数之上,以便使用。我能做什么 #include <iostream> #include <cstdlib> using namespace std; int convert() { int operation; switch(operation){ case '1': case '2': case '3': case '4': ; } return 0; } int main() { std::string formatIn; std::string FormatOut; std::string confirm; cout << "select format that file is currently in: mp3, gp3, mp4, flv" << endl; cin >> formatIn; cout << "original format = " << formatIn << endl; cout << "choose your target format: mp3, gp3, mp4, flv" << endl; cin >> FormatOut; cout << "selected format = " << FormatOut << endl; cout << "proceed? "; cin >> confirm; if(confirm == "yes"){ cout << "proceeding with operation:" << endl; convert(); } else{ if(confirm == "no"){ cout << "canceling,,," << endl; } } } #包括 #包括 使用名称空间std; int convert() { int操作; 开关(操作){ 案例“1”: 案例“2”: 案例“3”: 案例“4”: ; } 返回0; } int main() { std::字符串格式; std::字符串格式化; std::字符串确认; 不能形成素; cout

函数和变量“;鸡还是蛋;脚本 我正在编写一个简单的程序,用C++运行FFMPEG,但是我需要在“Mault”中定义某些变量,但是函数需要在主函数之上,以便使用。我能做什么 #include <iostream> #include <cstdlib> using namespace std; int convert() { int operation; switch(operation){ case '1': case '2': case '3': case '4': ; } return 0; } int main() { std::string formatIn; std::string FormatOut; std::string confirm; cout << "select format that file is currently in: mp3, gp3, mp4, flv" << endl; cin >> formatIn; cout << "original format = " << formatIn << endl; cout << "choose your target format: mp3, gp3, mp4, flv" << endl; cin >> FormatOut; cout << "selected format = " << FormatOut << endl; cout << "proceed? "; cin >> confirm; if(confirm == "yes"){ cout << "proceeding with operation:" << endl; convert(); } else{ if(confirm == "no"){ cout << "canceling,,," << endl; } } } #包括 #包括 使用名称空间std; int convert() { int操作; 开关(操作){ 案例“1”: 案例“2”: 案例“3”: 案例“4”: ; } 返回0; } int main() { std::字符串格式; std::字符串格式化; std::字符串确认; 不能形成素; cout,c++,ffmpeg,C++,Ffmpeg,给函数一个参数: int convert(int operation) { switch(operation){ 然后在main中传递一个参数: int operation = .... int c = convert(operation); 为函数指定一个参数: int convert(int operation) { switch(operation){ 然后在main中传递一个参数: int operation = .... int c = convert(opera

给函数一个参数:

int convert(int operation)
{
    switch(operation){
然后在
main
中传递一个参数:

int operation = ....
int c = convert(operation);

为函数指定一个参数:

int convert(int operation)
{
    switch(operation){
然后在
main
中传递一个参数:

int operation = ....
int c = convert(operation);

为函数指定一个参数:

int convert(int operation)
{
    switch(operation){
然后在
main
中传递一个参数:

int operation = ....
int c = convert(operation);

为函数指定一个参数:

int convert(int operation)
{
    switch(operation){
然后在
main
中传递一个参数:

int operation = ....
int c = convert(operation);


您可以将参数从一个函数传递到另一个函数,您可以将函数和“公共”变量包装到一个类中,或者您可以使用全局变量。因此,手头有很多解决方案。您可以将参数从一个函数传递到另一个函数,您可以包装函数和“公共”变量一个类中的变量,或者你可以使用全局变量。所以有很多解决方案。你可以将参数从一个函数传递到另一个函数,你可以包装函数和“公共”一个类中的变量或者你可以使用全局变量。所以手头上有很多解决方案。你可以将参数从一个函数传递到另一个函数,你可以将函数和“公共”变量包装在一个类中,或者你可以使用全局变量。所以手头上有很多解决方案。我不太明白,什么是int convert(int操作)@ USSR2426923,这是函数参数,正如我的答案所建议的。如果你不知道它是什么,你需要学习C++的基础知识。我知道它的参数,我不是NoOB的大。我想知道这是如何帮助我从int()中获取变量的。@user3426923您在调用函数时传递参数,正如我在回答中所解释的。我真的不知道如何将所有变量传递回函数。我得到的是,几乎什么都没有。我不太明白,int convert(int操作)是什么@ USSR2426923,这是函数参数,正如我的答案所建议的。如果你不知道它是什么,你需要学习C++的基础知识。我知道它的参数,我不是NoOB的大。我想知道这是如何帮助我从int()中获取变量的。@user3426923您在调用函数时传递参数,正如我在回答中所解释的。我真的不知道如何将所有变量传递回函数。我得到的是,几乎什么都没有。我不太明白,int convert(int操作)是什么@ USSR2426923,这是函数参数,正如我的答案所建议的。如果你不知道它是什么,你需要学习C++的基础知识。我知道它的参数,我不是NoOB的大。我想知道这是如何帮助我从int()中获取变量的。@user3426923您在调用函数时传递参数,正如我在回答中所解释的。我真的不知道如何将所有变量传递回函数。我得到的是,几乎什么都没有。我不太明白,int convert(int操作)是什么@ USSR2426923,这是函数参数,正如我的答案所建议的。如果你不知道它是什么,你需要学习C++的基础知识。我知道它的参数,我不是NoOB的大。我想知道这是如何帮助我从int()中获取变量的。@user3426923您在调用函数时传递参数,正如我在回答中所解释的。我真的不知道如何将所有变量传递回函数。我得到的是,几乎什么都没有。