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


ifstream and for loop

Recommended Posts

Motwner    122
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;,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