Ver Mensaje Individual
  #7 (permalink)  
Antiguo 09/02/2010, 12:37
Avatar de fradve
fradve
 
Fecha de Ingreso: abril-2009
Mensajes: 157
Antigüedad: 15 años, 1 mes
Puntos: 7
Respuesta: Paso de valores entre funciones

Tienes que colocar dentro de a función menú un bucle que mientras se no se cumpla una codición permanezca dentro pueder ser un do while, así:

Código C++:
Ver original
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.    
  4. void menu();
  5. int leer(int *a, int *b, int *c);
  6. void escribir(int a, int b, int c);
  7.  
  8. int main()
  9. {
  10.      menu();
  11.      return 0;
  12. }
  13.  
  14. void menu()
  15. {
  16.      int a,b,c;
  17.      char opcion;
  18.  
  19.        
  20.      do
  21.      {
  22.          system("CLS");
  23.          printf("**** MENU PRINCIPAL ****\n\n");
  24.          printf("1. Leer un numero\n");
  25.          printf("2. Escibir numero\n");
  26.          printf("0. Salir\n");
  27.          opcion=getche();
  28.  
  29.          switch (opcion)
  30.         {
  31.                  case '1':
  32.                               leer(&a,&b,&c);
  33.                               break;
  34.                  case '2': escribir(a,b,c);
  35.                               break;
  36.                  case '0': printf("***Saliendo del Sistema***\n");
  37.                               break;
  38.                  default : printf("***Opcion no valida!***\n");
  39.         }
  40.     }while(opcion!='0');
  41. }
__________________
En programación hay mil y un formas de hacer lo mismo...