fopen_s(&pFile, "House.nfg", "r+"); for (;i < 100;++i) { fscanf_s(pFile, " %*d. pos:[%f, %f, %f]; norm:[%*f, %*f, %*f]; binorm:[%*f, %*f, %*f]; tgt:[%*f, %*f, %*f]; uv:[%f, %f];", &verticesData[i].pos.x, &verticesData[i].pos.y, &verticesData[i].pos.z, &verticesData[i].uv.x, &verticesData[i].uv.y); ++i; } 

text format in the file NrVertices: 170

  0. pos:[-881.551086, -0.000000, 955.795349]; norm:[0.000000, 0.000000, 1.000000]; binorm:[0.000000, 1.000000, 0.000000]; tgt:[1.000000, 0.000000, 0.000000]; uv:[0.014965, 0.006930]; 1. pos:[763.035583, -0.000000, 955.795349]; norm:[0.000000, 0.000000, 1.000000]; binorm:[0.000000, 1.000000, 0.000000]; tgt:[1.000000, 0.000000, 0.000000]; uv:[0.529346, 0.006930]; 

Closed due to the fact that off-topic participants insolor , user194374, zRrr , aleksandr barakin , Dmitriy Simushev Mar 27 '16 at 18:04 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Community spirit, zRrr, aleksandr barakin
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    The question is, in fact, in what? - Max ZS
  • does not read itself - SkiF

1 answer 1

Start with checks

  1. Whether the file is pFile (if the pFile value is not zero after opening).
  2. What is the initial value of i ? In the loop, it is not initialized - maybe it is already 1000 at the input :)
  3. Why do you have TWO i increments - in the header of the cycle and in the body?

After that, let's see what to do next (if it is further required at all).