Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Motwner

ifstream and for loop

This topic is 5952 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The following code will not work correctly. What happens is the axis output a memory location. If you have any idea whats wrong or need more of an explanation please post. char *fileptr="engtxt.txt"; ifstream DatFile; DatFile.open(fileptr,ios::binary); if (!DatFile) { cout<<"Cannot open the file"; DatFile.close(); //Close File } DatFile>>Sector.quad; //Read DatFile to chOut Sector.Square=new cSquare[Sector.quad]; float newx,newy,newz,newu,newv; for(int q=0;q>newx>>newy>>newz>>newu>>newv; Sector.Square[q].Vertex[vert].vx(newx); Sector.Square[q].Vertex[vert].vy(newy); Sector.Square[q].Vertex[vert].vz(newz); Sector.Square[q].Vertex[vert].vu(newu); Sector.Square[q].Vertex[vert].vv(newv); } } cout<

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!