Hello.
I have the following code to read one file.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main()
{
char tam[2]={ };
FILE *fp1, *fp2;
char line[4];
fp1 = fopen("brd2.ltr","r");
fgets(tam,2,fp1);
printf("TAMANHO->%s\n",tam);
while(fgets(line,3,fp1))
{
printf("%c%c%c",line[0],line[1],line[2]);
}
fclose(fp1);
}
The file look like this:
4
A (B) A B
(C)[B](A) D
D (A) C D
(A)[B](D) C
I'm trying that my program does this:-
First line : Size of board
Next lines reading 3 by 3 chars and put then in 2D arrays.
Now i have problems reading first line.
tks in advanced,
HIT