Hello, can anyone help me with this code? I know that the problem is caused by the array, but I donīt know how to solve it.
Code:
//---------------------------------------------------------------------------
#pragma hdrstop
//---------------------------------------------------------------------------
#include <stdio.h>
#pragma argsused
void main(int argc, char* argv[])
{
char textov[255];
FILE *archivo;
archivo= fopen("c:\\ecer.txt", "r");
if (archivo == NULL){
printf("El archivo ecer.txt no se encuentra en el directorio adecuado, o no existe");
}
else{
printf("El archivo existe");
fscanf(archivo,"%c", &textov);
}
printf("%c", textov);
getch();
}
The array only keep one letter("ę"), and is a wrong letter, because it is not in ecer.txt. I thnik that I am wrong reading the text and keeping it in the array, can anyone help me?