Foro de elhacker.net

Programación => Programación C/C++ => Mensaje iniciado por: jesus24d en 7 Junio 2017, 18:14 pm



Título: error: too many arguments to functio
Publicado por: jesus24d en 7 Junio 2017, 18:14 pm
acá esta el código :

Código
  1. #include<iostream>
  2. using namespace std;
  3. void ordenar();
  4. int main(){
  5.  
  6. int vector[5] = {2,4,5,3,1};
  7. ordenar(vector);
  8. for(int i=0; i<5; i++){
  9. cout<<vector[i]<<" ";
  10. }
  11. return 0;
  12. }
  13.  
  14. void ordenar(int v[5]){
  15. int i, n, pos, aux;
  16. n= sizeof(v)/sizeof(v[0]);
  17. for(i=0; i<5; i++){
  18. pos = i;
  19. aux = v[i];
  20.  
  21. while((pos>0) && v[pos-1]>aux){
  22. v[pos] = v[pos-1];
  23. pos--;
  24. }
  25. v[pos] = aux;
  26. }
  27. }
Los codigos deben ir en etiquetas GeSHi


Título: Re: error: too many arguments to functio
Publicado por: engel lex en 7 Junio 2017, 18:44 pm
linea 3 no declaras argumentos, debe estar igual que la linea 14


Título: Re: error: too many arguments to functio
Publicado por: jesus24d en 9 Junio 2017, 21:04 pm
linea 3 no declaras argumentos, debe estar igual que la linea 14

si amigo era eso faltaban los argumentos. muchisimas gracias.