// In my Class A, I have many nodes and every node data is stored in a struct like this:
Class A 
{
private:
  struct BriteNodeInfo
  {
    int nodeId;
    double xCoordinate;
    double yCoordinate;
    int inDegree;
    int outDegree;
    int asId;
    std::string type;
  };
};
  // Each node instance is stored in a vector like this:
  typedef std::vector<BriteNodeInfo> BriteNodeInfoList;
  BriteNodeInfoList m_briteNodeInfoList;
//And then, here is the function that I want to implent down below
void SaveNodeData (std::string fname);
};
Problem: How do I implent that SaveNodeData() function to save my nodes data in .txt file like this?:
  nodeId0   yCoordinate0   xCoordinate0
  nodeId1   yCoordinate1   xCoordinate1
  nodeId2   yCoordinate2   xCoordinate2
  nodeId3   yCoordinate3   xCoordinate3
   etc...
I have tried but my iteration syntax is not good enough. Here is my function, please help:
Here is my failed function:
void SaveNodeData (std::string fname)
{
  ofstream os(fname.c_str(), ios::trunc);
  vector<BriteNodeInfo> BriteNodeInfoList;
  BriteNodeInfoList m_briteNodeInfoList;
  for (BriteNodeInfoList::Iterator i = m_briteNodeInfoList.Begin(); i != m_briteNodeInfoList.End(); ++i)
    {  
        os << BriteNodeInfo[i].nodeId "\t" << "\t" << BriteNodeInfo[i].yCoordinate; << "\t"BriteNodeInfo[i].xCoordinate<< "\n";
    }
    os << "\n";
 }
 
    