i have a function that is going to read from a file, first look for the specific check number the user is trying to see, then print it to the screen, i got it to work by just taking all the data, until "-" shows up, the break point between each record, but i need to divide everyline into a variable so i can put everything very fancy, the only problem is that im not pretty good a C, and i've try many things, gone thru several forums, i don't have a book, and i need to turn this in soon.
![]()
thanks in advance, here goes the function;
Code:void mostrarcheque() { system ("cls"); printf("\n%-27cImpresion de Cheques\n\r"); printf("\n%-28cMostrar Cheques\n\r"); FILE *file; file = fopen("cheques.txt", "r"); struct cheque micheque; char buffer[255]; char buffer_numerocheque[3]; int key = 0; printf("\n%-7cBuscar por: \n\r"); printf("\n%-7cEscriba el Cheque : "); fgets (buffer_numerocheque,255,stdin); if(file==NULL) { printf("Error: No se pudo abrir el archivo.\n"); } else { while(fgets(buffer, 255, file)!= NULL) { if ( strcmp (buffer, buffer_numerocheque) == 0 ) { printf("\n********************************************************************************\n\n\r"); printf("\n%-60cCheque No."); do { buffer==micheque.numerodecheque; printf("%i\n", micheque.numerodecheque); fgets(buffer, 255, file); buffer==micheque.destinatario; fgets(buffer, 255, file); buffer==micheque.fecha; fgets(buffer, 255, file); buffer==micheque.nocuenta; fgets(buffer, 255, file); buffer==micheque.banco; fgets(buffer, 255, file); buffer==micheque.monto; } while ( buffer[0] != '-' ); break; } } } printf("\n\n%-50c____________________________ \n\r"); printf("\n%-60cFirma \n\r"); printf("\n********************************************************************************\n\n\r"); continuar(); }



LinkBack URL
About LinkBacks
, the only problem is that im not pretty good a C, and i've try many things, gone thru several forums, i don't have a book, and i need to turn this in soon.



