fgets... da un error
Publicado por luis r. (5 intervenciones) el 18/10/2000 00:00:00
fgets... da un error. Al hacer un programa tan simple como el siguiente :
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <process.h>
#include <string.h>
#define LIN 81
FILE *fi;
void main (void)
{
char cad[LIN];
fi = fopen("c:\rik\texto.txt,","r+");
while (fgets(cad,LIN,fi)!=NULL)
{
printf("%s",cad);
}
fclose(fi);
}
LO COMPILA BIEN NO DA ERRORES PERO AL EJECUTARLO APARECE LOS SIGUIENTE:
Debug Assertion Failed!
Program :c:\rik\c++\debug\Borrar.exe ---> nombre del ejecutable
File :fgets.c.
line:60
Expresion : str!=NULL
For information on your program can cause an assertion failure , see the Visual C++ documentation on assert.
NECESITO AYUDA ES MEDIO URGENTE, QUE PUEDE PASAR COMO LO PUEDO SOLUCIONAR ES POR EL C++.
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <process.h>
#include <string.h>
#define LIN 81
FILE *fi;
void main (void)
{
char cad[LIN];
fi = fopen("c:\rik\texto.txt,","r+");
while (fgets(cad,LIN,fi)!=NULL)
{
printf("%s",cad);
}
fclose(fi);
}
LO COMPILA BIEN NO DA ERRORES PERO AL EJECUTARLO APARECE LOS SIGUIENTE:
Debug Assertion Failed!
Program :c:\rik\c++\debug\Borrar.exe ---> nombre del ejecutable
File :fgets.c.
line:60
Expresion : str!=NULL
For information on your program can cause an assertion failure , see the Visual C++ documentation on assert.
NECESITO AYUDA ES MEDIO URGENTE, QUE PUEDE PASAR COMO LO PUEDO SOLUCIONAR ES POR EL C++.
Valora esta pregunta


0