Archived

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

Motwner

ifstream and for loop

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