elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Curso de javascript por TickTack


  Mostrar Mensajes
Páginas: 1 [2]
11  Programación / Programación C/C++ / Re: FUNCIONES Y PROCEDIMIENTO en: 28 Abril 2011, 20:05 pm
disculpa podrias especificar mejor en donde esta mi error. GRACIAS ;)    :huh:
12  Programación / Programación C/C++ / Re: FUNCIONES Y PROCEDIMIENTO en: 28 Abril 2011, 19:53 pm
Código
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. void leer(int,int,int);
  7. void operacion(int ,int ,int );
  8.  
  9.  
  10.  
  11. int main(int argc, char *argv[])
  12. {  
  13.    int edad1,nac1,act1;
  14.  
  15.   leer(edad1,nac1,act1);
  16.   operacion(edad1,nac1,act1);
  17.  
  18.  
  19.    system("PAUSE");
  20.    return EXIT_SUCCESS;
  21. }
  22.  
  23. void leer(int &edad,int &nac,int &act)
  24. {    
  25.  
  26.     cout<<"ingrese Edad"<<endl;
  27.     cin>>edad;
  28.     cout<<"ingrese Año de Nacimiento"<<endl;
  29.     cin>>nac;
  30.     cout<<"ingrese Año Actual"<<endl;
  31.     cin>>act;    
  32.  
  33. }
  34.  
  35. void operacion(int &edad,int &nac,int &act)
  36. {    
  37.     cout<<"Bueno el tendras "<<(act-nac+edad)<<endl;          
  38.     cin>>edad;
  39.     cout<<edad;
  40.  
  41.   }
  42.  
13  Programación / Programación C/C++ / Re: FUNCIONES Y PROCEDIMIENTO en: 28 Abril 2011, 19:51 pm

Buenas TArdes El Siguiente codigo no me compila
Código
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. void leer(int,int,int);
  7. void operacion(int ,int ,int );
  8.  
  9.  
  10.  
  11. int main(int argc, char *argv[])
  12. {  
  13.    int edad1,nac1,act1;
  14.  
  15.   leer(edad1,nac1,act1);
  16.   operacion(edad1,nac1,act1);
  17.  
  18.  
  19.    system("PAUSE");
  20.    return EXIT_SUCCESS;
  21. }

y no comprendo por que no compila.
en la parte inferior me sale las siguistes obsevaciones.
  

  [Linker error] undefined reference to `leer(int, int, int)'
  [Linker error] undefined reference to `operacion(int, int, int)'
  ld returned 1 exit status



espero  SU AYUDA .!GRACIAS!



14  Programación / Programación C/C++ / Re: FUNCIONES Y PROCEDIMIENTO en: 28 Abril 2011, 19:45 pm
hola  gracias ... pero DONDE   ME INFORMO PARA PODER  postear de la mejor forma "EN ESTE FORO" gracias.
15  Programación / Programación C/C++ / FUNCIONES Y PROCEDIMIENTO en: 28 Abril 2011, 19:39 pm

BUENAS TARDE








#include <cstdlib>
#include <iostream>

using namespace std;

void leer(int,int,int);
void operacion(int ,int ,int );



int main(int argc, char *argv[])
{   
    int edad1,nac1,act1;
   
   leer(edad1,nac1,act1);
   operacion(edad1,nac1,act1);
   
                     
    system("PAUSE");
    return EXIT_SUCCESS;
}

void leer(int &edad,int &nac,int &act)
{   
             
     cout<<"ingrese Edad"<<endl;
     cin>>edad;
     cout<<"ingrese Año de Nacimiento"<<endl;
     cin>>nac;
     cout<<"ingrese Año Actual"<<endl;
     cin>>act;     
       
}

void operacion(int &edad,int &nac,int &act)
{   
     cout<<"Bueno el tendras "<<(act-nac+edad)<<endl;         
     cin>>edad;
     cout<<edad;
     
   }
Páginas: 1 [2]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines