Este es el codigo, tal y como me has dicho q lo envie.Esta echo en visual c/c++ 6.0. Es mejor tener el programa para compilarlo y moverlo. Hay mas codigo, realmente esta todo el programa echo pero he ido kitando y esto es lo minimo que creo que se puede poner. Cualquier cosa me comunicais. Ya os he agregado al msn. Si teneis codigo de arboles que pueda servirme lo pasais si no os importa.
[email protected]
CLIENET.CPP:
#include "lib.hpp"
int main()
{
int opc;
//arbolc c=NULL;
system("cls");
opc=menu();
while (opc!=5)
{
switch (opc)
{
case 1: //aeropuerto();
break;
case 2:{
clientes(&c);
}
break;
case 3://viajes();
break;
case 4: optimización();
break;
}
opc=menu();
}
getch();
return(0);
}
CLIENTE.HPP:
#include "lib.hpp"
void clientes(arbolc *c);
int menu_clientes();
int menu();
LIB.HPP:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#include "cliente.hpp"
#include "menu.hpp"
#include "struct.hpp"
MENU.HPP:
void clientes(arbolc *c)
{
int opc2;
cliente datos_cliente;
system("cls");
opc2=menu_clientes();
while (opc2!=5)
{
switch (opc2)
{
case 1:{
//datoscli(*c, &datos_cliente);
//alta_cliente(&c, datos_cliente);
}
break;
case 2:{
//baja_cliente(&c);
}
break;
case 3: //modificacion_cliente(&datos_cliente);
break;
case 4: //listado_cliente(c);
break;
}
opc2=menu_clientes();
}
}
int menu()
{
char opc;
printf(" **************\n");
printf(" MENU PRINCIPAL\n");
printf(" 1- AEROPUERTO\n");
printf(" 2- CLIENTES\n");
printf(" 3- VIAJES\n");
printf(" 4- OPTIMIZACION\n");
printf(" 5- SALIR\n");
printf(" **************\n");
printf(" Escoja la opcion deseada: \n");
while ((opc=getch())<'1' || opc>'5');
return(opc-'0');
}
int menu_clientes()
{
char opc2;
printf(" **************\n");
printf(" MENU CLIENTES\n");
printf(" 1- ALTA\n");
printf(" 2- BAJA\n");
printf(" 3- MODIFICACION\n");
printf(" 4- LISTADOS\n");
printf(" 5- SALIR\n");
printf(" **************\n");
printf(" Escoja la opcion deseada: \n");
while ((opc2=getch())<'1' || opc2>'5');
return(opc2-'0');
}
STRUCT.HPP:
struct cliente
{
int codigoc;
char dni[9];
char nombre[20];
char apellido1[20];
char apellido2[20];
char poblacion[20];
char provincia[15];
char telefono[12];
int edad;
float saldo;
};
typedef struct cliente cliente;
struct nodoc
{
cliente info;
struct nodoc *dra;
struct nodoc *izda;
};
typedef struct nodoc nodoc;
typedef nodoc *arbolc;
GRACIAS Por TODO