Does anyone know if there is any restriction by using 'fscanf' in projects using GLUT (OpenGL)? I am trying to do a simple thing... read a point cloud (x, y, z) from a text file but the 'fscanf' does not get correctly the values... The same code in a project for console application in code::blocks works well.

Does anyone have a suggestion what is my mistake? 

Code:

 #include <windows.h>
 #ifdef __APPLE__
 #else
 #include <GL/glut.h>
 #endif

 #include <stdlib.h>
 #include <stdio.h>
 #include <math.h>
 #include <conio.h>

int main()
{
    int i;
    int v1x;
    int vetor[9]; // 3 points

    FILE *occluded_triangles;

    occluded_triangles = fopen("occluded_triangles.txt","rt");

    for(i=0;i<9;i++)
    {
        fscanf(occluded_triangles,"%d", &v1x);
        vetor[i] = v1x;
    }

    for(i=0; i<9; i++)
    {
        printf("%d\n",vetor[i]);
    }

    system("pause");
    return 0;
}