1
Someone can help me, this program is making several mistakes, but I can not find any. I thank you already.
Mistakes:
- [Error] cannot Convert 'int*' to 'int**' for argument '3' to 'int reading(int, int, int**)'
- [Error] invalid Conversion from 'int' to 'int*' [-fpermissive]
- [Error] initializing argument 3 of 'int impressao(int, int*)' [-fpermissive]
- [Error] invalid Conversion from 'int' to 'int*' [-fpermissive]
- [Error] initializing argument 4 of 'int somatorio(int, int*, int*)' [-fpermissive]
- [Error] invalid Conversion from 'int' to 'int*' [-fpermissive]
- [Error] initializing argument 3 of 'int maior(int, int*, int*)' [-fpermissive]
- [Error] Expression list treated as compound Expression in initializer [-fpermissive]
[Error] ISO C++ forbids comparison between Pointer and integer [-fpermissive]
#include <iostream> #include <string.h> #include <sstream> #include <cmath> using namespace std; int leitura(int i, int q_numeros, int *vetor[1000]); int impressao(int i, int q_numeros, int vetor[1000]); int somatorio(int i, int q_numeros, int *soma, int vetor[1000]); int maior(int i, int q_numeros, int vetor[1000], int *max); int fimpar(int *impar, int i, int q_numeros, int vetor[1000]); int main(){ int q_numeros, vetor[1000], i, max, soma, impar; cout<<"Programa que apartir dos numeros inseridos diz quem são eles, o seu somatorio, qual é o maior e quantos impares foram digitados."; cout <<"\nDigite quantidade de numeros a ser inseridos no programa:"; cin >> q_numeros; leitura(i, q_numeros, &vetor[1000]); impressao(i, q_numeros, vetor[1000]); somatorio( i, q_numeros, &soma,vetor[1000]); cout<<"\nSomatorio dos numeros digitados é:"<<soma<<endl; maior( i, q_numeros, vetor[1000], &max); cout<<"\nMaior numero é: "<< max<<endl; int fimpar (&impar, i, q_numeros, vetor[1000]); cout<<"n\A quantidade de numeros impares é: "<< impar<<endl; return 0; } int leitura(int i, int q_numeros, int *vetor[1000]){ cout<<"digite os numeros"; for(i=0; i<q_numeros;i++){ cin >> *vetor[i]; } return 0; } int impressao(int i, int q_numeros, int vetor[1000]){ cout << "Numeros digitados foram:\n"; for(i=0; i<q_numeros;i++) { cout << vetor[i]<<"\n"<< endl; } return 0; } int somatorio(int i, int q_numeros, int *soma, int vetor[1000]){ for(i=0; i<q_numeros;i++){ *soma=*soma+vetor[i]; } return 0; } int maior(int i, int q_numeros, int vetor[1000], int *max){ for(i=0; i<q_numeros;i++) { if (max<vetor[i]) { *max=vetor[i]; } else{ } } return 0; } int fimpar (int *impar, int i, int q_numeros, int vetor[1000]) { for(i=0; i<q_numeros;i++){ if ((vetor[i] % 2) == 0){ } else { *impar++; } } return 0; }
Can list which errors are appearing?
– Andre Figueiredo
Whenever you ask a question, be as specific as possible. In this case, you have not reported what errors occur. Recommend visiting these links: http://answall.com/tour. and primarily http://answall.com/questions/how-to-ask-beta
– Giovani
Why so many negative votes so fast? The guy is new, the tip was given in the comments. I think they could wait a little, even discourage the boy to supplement the question.
– Joao Paulo
@Joaopaulo I did not give -1, but I believe some of them were because the original question (before my edition) was deformed.
– Andre Figueiredo
Thanks for the help. I will elaborate the next questions better.
– Henrique Melo
@Andréfigueiredo In my way of seeing these negative votes (if given immediately) can drive away new users who have not yet learned and also cause experienced users not to click the question to answer it because they think it really doesn’t fit, even if it has already been edited and complemented in the correct way.
– Joao Paulo
@Joaopaulo I agree, because there are people who refuse and do not withdraw the vote, when the question became good.
– Andre Figueiredo