C/Visual C - fgets... da un error

 
Vista:

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++.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:fgets... da un error

Publicado por raul (5 intervenciones) el 18/10/2000 00:00:00
prueba a poner dos barras invertidas en la ruta del archivo c:\\rik\\texto.txt
saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar