PODEIS MIRAR-ME PQ NO VA EL PROGRAMA DE LA AGENDA ME HE QUEDADO ENCALLADISIMO...GRACIAS!!!
//---------------------------------------------------------------------------
#include<conio.h>
#include<math.h>
#include<iostream.h>
#include<string.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
void menuprincipal();
void entradadedatos();
void visualizar();
int main(int argc, char* argv[])
{char ch;
menuprincipal();
while(1)
{gotoxy(16,4);
cin>>ch;
switch(ch)
{ case'1':{
entradadedatos();
menuprincipal();
break;
}
case'2':{
visualizar();
menuprincipal();
break;
}
}
if(ch=='3')break;
}
getch();
return 0;
}
//---------------------------------------------------------------------------
void menuprincipal(void)
{
cout<<" ÉÍÍÍÍÍÍÍÍÍÍÍMENU PRINCIPALÍÍÍÍÍÍÍÍÍÍÍ»"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º OPCIONES º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º 1-Entrada de datos º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º 2-Visualizar º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º 3-Salir º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"<<endl;
}
void entradadedatos(void)
{
cout<<" ÉÍÍÍÍÍÍÍÍÍENTRADA DE DATOSÍÍÍÍÍÍÍÍÍÍÍ»"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º Registro: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Nombre: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Apellidos: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Direccion: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Poblacion: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Codigo Postal: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Telefono: º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º C=> Continuar º"<<endl;
cout<<" º º"<<endl;
cout<<" º R=> Retroceder º"<<endl;
cout<<" º º"<<endl;
cout<<" º Opcion: º"<<endl;
cout<<" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"<<endl;
char ch;
int reg;
struct Agenda{char nombre[20];
char apellido[20];
char direccion[50];
char poblacion[13];
int codigopostal[6];
int telefono[10];
};
do { gotoxy(15,4);
cout<<" ";
gotoxy(15,4);
cin>>reg;
}
while (reg<0||reg>9);
while(1)
{gotoxy(13,6);
cin>>Agenda[reg].nombre;
gotoxy(16,8)
cin>>Agenda[reg].apellido;
gotoxy(16,10)
cin>>Agenda[reg].direccin;
gotoxy (16,12);
cin>>Agenda[reg].poblacion;
gotoxy (20,14);
cin>>Agenda[reg].codigo postal;
gotoxy (15,16);
cin>>Agenda[reg].telefono;
gotoxy (14,24);
cin>>ch;
if(ch=='r'||ch=='R')
{
break;
}
reg++
if(reg>9)
{ reg==0;
}
clrscr();
menu datos();
}
}
void visualizar(void);
{
cout<<" ÉÍÍÍÍÍÍÍÍÍVISUALIZARÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º Registro: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Nombre: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Apellidos: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Direccion: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Poblacion: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Codigo Postal: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Telefono: º"<<endl;
cout<<" º º"<<endl;
cout<<" º + => Siguiente registro º"<<endl;
cout<<" º º"<<endl;
cout<<" º - => Registro anterior º"<<endl;
cout<<" º º"<<endl;
cout<<" º R => Retroceso (menu principal) º"<<endl;
cout<<" º º"<<endl;
cout<<" º Opcion: º"<<endl;
cout<<" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"<<endl;
}
#include<conio.h>
#include<math.h>
#include<iostream.h>
#include<string.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
void menuprincipal();
void entradadedatos();
void visualizar();
int main(int argc, char* argv[])
{char ch;
menuprincipal();
while(1)
{gotoxy(16,4);
cin>>ch;
switch(ch)
{ case'1':{
entradadedatos();
menuprincipal();
break;
}
case'2':{
visualizar();
menuprincipal();
break;
}
}
if(ch=='3')break;
}
getch();
return 0;
}
//---------------------------------------------------------------------------
void menuprincipal(void)
{
cout<<" ÉÍÍÍÍÍÍÍÍÍÍÍMENU PRINCIPALÍÍÍÍÍÍÍÍÍÍÍ»"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º OPCIONES º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º 1-Entrada de datos º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º 2-Visualizar º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º 3-Salir º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"<<endl;
}
void entradadedatos(void)
{
cout<<" ÉÍÍÍÍÍÍÍÍÍENTRADA DE DATOSÍÍÍÍÍÍÍÍÍÍÍ»"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º Registro: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Nombre: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Apellidos: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Direccion: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Poblacion: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Codigo Postal: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Telefono: º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º C=> Continuar º"<<endl;
cout<<" º º"<<endl;
cout<<" º R=> Retroceder º"<<endl;
cout<<" º º"<<endl;
cout<<" º Opcion: º"<<endl;
cout<<" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"<<endl;
char ch;
int reg;
struct Agenda{char nombre[20];
char apellido[20];
char direccion[50];
char poblacion[13];
int codigopostal[6];
int telefono[10];
};
do { gotoxy(15,4);
cout<<" ";
gotoxy(15,4);
cin>>reg;
}
while (reg<0||reg>9);
while(1)
{gotoxy(13,6);
cin>>Agenda[reg].nombre;
gotoxy(16,8)
cin>>Agenda[reg].apellido;
gotoxy(16,10)
cin>>Agenda[reg].direccin;
gotoxy (16,12);
cin>>Agenda[reg].poblacion;
gotoxy (20,14);
cin>>Agenda[reg].codigo postal;
gotoxy (15,16);
cin>>Agenda[reg].telefono;
gotoxy (14,24);
cin>>ch;
if(ch=='r'||ch=='R')
{
break;
}
reg++
if(reg>9)
{ reg==0;
}
clrscr();
menu datos();
}
}
void visualizar(void);
{
cout<<" ÉÍÍÍÍÍÍÍÍÍVISUALIZARÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º º"<<endl;
cout<<" º Registro: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Nombre: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Apellidos: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Direccion: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Poblacion: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Codigo Postal: º"<<endl;
cout<<" º º"<<endl;
cout<<" º Telefono: º"<<endl;
cout<<" º º"<<endl;
cout<<" º + => Siguiente registro º"<<endl;
cout<<" º º"<<endl;
cout<<" º - => Registro anterior º"<<endl;
cout<<" º º"<<endl;
cout<<" º R => Retroceso (menu principal) º"<<endl;
cout<<" º º"<<endl;
cout<<" º Opcion: º"<<endl;
cout<<" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"<<endl;
}
