Aquí esta parte del código, perdón si esta asi, lo copie rápido.
Código
#include <string.h> #include <iostream> #include <windows.h> #include <conio.h> using namespace std; void gt(int x, int y){ // -Posicion X y Y en el Programa HANDLE Manipulador; //Puntero COORD Coordenadas; //Coordenadas Manipulador = GetStdHandle(STD_OUTPUT_HANDLE); //Contenedor del Programa Coordenadas.X = x; //Posicion en X Coordenadas.Y = y; //Posicion en Y SetConsoleCursorPosition(Manipulador,Coordenadas); //Envia el Contenedor y variable para la posicion } void formu(){ system("cls"); gt(15,9); cout<<"Codigo: "; gt(15,11); cout<<"Nombres: "; gt(15,12); cout<<"Apellidos: "; gt(15,14); cout<<"Nota 1: "; gt(15,15); cout<<"Nota 2: "; gt(15,17); cout<<"Su Nota Definitiva es: "; } struct notas{ char nom[50]; char apel[50]; char cod[50]; float n1, n2; float defi; }alu, *pun=&alu; void capt(); void list(); void consul(); int ne; int main(){ char op; do{ system("cls"); gt(20,10); cout<<"MENU REGISTROS"; gt(22,12); cout<<"1. Capturar."; gt(22,13); cout<<"2. Consultar registros."; gt(22,14); cout<<"3. Salir."; gt(23,16); cout<<char(167)<<"Digite un numero: "; op = getch(); switch(op){ case '1': capt(); break; case '2': consul(); break; case '3': gt(6,18); cout<<"Saliendo..."; Sleep(200); gt(5,25); exit(1); break; default: gt(6,18); cout<<"Debe digitar un numero del 1 al 3..."; system("pause"); break; } } while(op != '3'); } void capt(){ system("cls"); gt(15,10); cout<<"Digite el Numero de Formularios a agregar: "; cin>>ne; const int ju = ne; for(int i=0;i<ju;i++){ formu(); fflush(stdin); gt(23,9); gets((pun+i)->cod); gt(24,11); gets((pun+i)->nom); gt(26,12); gets((pun+i)->apel); gt(23,14); cin>>(pun+i)->n1; gt(23,15); cin>>(pun+i)->n2; (pun+i)->defi=((pun+i)->n1+(pun+i)->n2)/2; gt(38,17); cout<<(pun+i)->defi; system("pause"); } ne = ju; } void consul(){ char op; do{ system("cls"); gt(20,10); cout<<"MENU - Consultas"; gt(22,12); cout<<"1. Listar."; gt(22,13); cout<<"2. Volver al menu anterior"; gt(22,14); cout<<"3. Salir"; gt(23,16); cout<<"Digite un numero: "; op = getch(); switch(op){ case '1': list(); break; case '2': gt(6,18); cout<<"Volviendo..."; Sleep(200); main(); break; case '3': gt(6,18); cout<<"Saliendo..."; Sleep(200); gt(5,25); exit(1); break; default: gt(6,18); cout<<"Digite un numero del 1 al 3..."; system("pause"); break; } } while(op != '4' || op == '2'); system("pause"); } void list(){ system("cls"); fflush(stdin); if((pun)->defi == 0){ gt(15, 10); cout<<"No se Encontraron Registros..."; } else{ gt(16,8); cout<<"--- REGISTROS ---"; gt(3,10); cout<<"No."; gt(7,10); cout<<"Codigo"; gt(17,10); cout<<"Nombre"; gt(33,10); cout<<"Apellido"; gt(47,10); cout<<"Nota 1"; gt(57,10); cout<<"Nota 2"; gt(67,10); cout<<"Definitiva"; for(int i=0;i<ne;i++){ gt(3,i+12); cout<<i+1; gt(7,i+12); cout<<(pun+i)->cod; gt(17,i+12); cout<<(pun+i)->nom; gt(32,i+12); cout<<(pun+i)->apel; gt(47,i+12); cout<<(pun+i)->n1; gt(57,i+12); cout<<(pun+i)->n2; gt(67,i+12); cout<<(pun+i)->defi; } system("pause"); } }
Y asi me queda cuando quiero mostrar los registros.
--- REGISTROS ---
No. Codigo Nombre Apellido Nota 1 Nota 2 Definitiva
1 32GRE ANDRES SUR 45 20 32.5
2 AH3H2 ♥ PEREZ 34 50 42
3 4H2BG ESTEBAN HONZ 45 35 40Presione una tecla para continuar . . .