1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
int* x_y(char* lien)
{
int ligne=0;
int caractere = 0;
int a = 0;
int * x_y;
x_y = (int *) malloc(sizeof(int)*(8));
int * X;
X = (int *) malloc(sizeof(int)*(2));
FILE* source = NULL;
source = fopen(lien, "rb");
if(source != NULL)
{
while (caractere != EOF)
{
caractere = fgetc(source);
if (ligne >= 18 && ligne <= 21)
{
x_y [a] = caractere;
a++;
}
else if (ligne >= 22 && ligne <= 25)
{
x_y [a] = caractere;
a++;
}
ligne ++;
}
}
fclose(source);
X[0]=x_y [0]+(x_y [1])*256+(x_y [2])*65536;//X
X[1]=x_y [4]+(x_y [5])*256+(x_y [6])*65536;//Y
return X;
} |