[英]Invalid conversion from int to int
#include <iostream>
#include<fstream>
using namespace std;
void showvalues(int,int,int []);
void showvalues2(int,int);
void sumtotal(int,int);
int main()
{
const int SIZE_A= 9;
int arreglo[SIZE_A];
ifstream archivo_de_entrada;
archivo_de_entrada.open("numeros.txt");
int count,suma,total,a,b,c,d,e,f;
int total1=0;
int total2=0;
//lee///
for(count =0 ;count < SIZE_A;count++)
archivo_de_entrada>>arreglo[count] ;
archivo_de_entrada.close();
showvalues(0,3,9); HERE IS THE PROBLEM
showvalues2(5,8);
sumtotal(total1,total2);
system("pause");
return 0;
}
void showvalues(int a,int b,int v)
{
//muestra////////////////////////
cout<< "los num son ";
for(count = a ;count <= b;count++)
total1 = total1 + arreglo[count];
cout <<total1<<" ";
cout <<endl;
}
void showvalues2(int c,int d)
{
//////////////////////////////
cout<< "los num 2 son ";
for(count =5 ;count <=8;count++)
total2 = total2 + arreglo[count];
cout <<total2<<" ";
cout <<endl;
}
void sumtotal(int e,int f)
{
/////////////////////////////////
cout<<"la suma de t1 y t2 es ";
total= total1 + total2;
cout<<total;
cout <<endl;
}
showvalues expects an int array as its third parameter - you are trying to pass a single int. showvalues期望将int 数组作为其第三个参数-您正尝试传递单个int。
You need to fix the prototype so that it matches the actual definition, ie change: 您需要修复原型,使其与实际定义匹配,即更改:
void showvalues(int,int,int []);
to: 至:
void showvalues(int,int,int);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.