I want to read a bunch of numbers from a file.
I have declared a few structures in structures
I passed a pointer from main to a local function and declared a dunamic array in it.
int readData(Point base[2], Vertex* vertices[])
{
int nPts = 0;
Vertex *vertex = new Vertex[48];
Vertex *pVertex = &vertex[0]; <----should I be using this pointer to read the values?
......
cout<<vertex[0].bldgId;
fin>>Vertex[0].bldgId;
cout<<vertex[0].bldgId;
}
I am trying to figure out how to read 1 of the values bldgId to the
dynamic array. The value in the file is '1' but it reads '4475424' for both cout statements.
My guess is its not reading it correctly? I think I declared and opened the file correctly. How could I read in the value?
Thx



LinkBack URL
About LinkBacks


