Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Temas - programador10

#1
Programación C/C++ / C++ vector por parametro.
10 Octubre 2011, 22:29 PM

hola buenas tardes.  NO COMPRENDO PORQUE no compila :( ... obs. no me sale ningun error. gracias POR SU AYUDA.

Código (cpp) [Seleccionar]
#include <cstdlib>
#include <iostream>
void leer(int v,int tam);
using namespace std;
int main(int argc, char *argv[])
{
    int v[50],n;
   
    cout<<"Ingresar Tamaño del Vector"<<endl;
    cin>>n;   
    leer(v[50],n);     
    system("PAUSE");
    return EXIT_SUCCESS;
}
void leer(int v[50],int tam)
{
     int i;   
     for (i=0;i<tam;i++)
     {
         cout<<"ingresar dato : "<<endl;
         cin>>v[i];
     }
     
}
#2
Hola disculpe no se porque no compila¿?
ayuda!
Código (cpp) [Seleccionar]
#include <cstdlib>
#include <iostream>
#define max 300
using namespace std;
void llenar(int &a);
void leer(int a,int b,int c);
int main(int argc, char *argv[])
{   
    int num[max],i,x,y,h;
   
    llenar(num);
    leer(x,y,h);
   
    system("PAUSE");
    return EXIT_SUCCESS;
}

void leer(int a,int b,int c)
{
     cout<<"Ingrese el valor X ...(0.x)"<<endl;
     cin>>a;
     cout<<"Ingrese el valor Y ...(0.y)"<<endl;
     cin>>b;
     cout<<"Ingrese el valor Z ...(0.z)"<<endl;
     cin>>c;
     
}
void llenar(int &a)
{   
     int i;
          for(i=0;i<max;i++)
          {
               a[i]=0;     
          }
}
#3
Buenas noches quisiera que me faciliten ejemplo de ARchivos y registros en c/c++  ...ejercicios resueltas MUCHAS GRACIAS.
#4

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;
     
   }