The following is to see what is my failure to write a code because I know that there is interaction (reading) between the program and the .odt file, which is the case that I tried, but I bring the text in strange symbols and not in letters. In the file that I named test.odt and it contains a line that says " testing read in C ", create the following code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *archivo;
char caracter;
archivo = fopen("prueba.odt","r");
if (archivo == NULL)
{
printf("\nError de apertura del archivo. \n\n");
}
else
{
printf("\nEl contenido del archivo de prueba es \n\n");
while((caracter = fgets(archivo)) != EOF)
{
printf("%s",caracter);
}
}
fclose(archivo);
return 0;
}
I know that the program reads the file, but as I said before, it brings an unintelligible content.