In C this would be done with an array, in C++ it is better to use container classes.however as the number of atoms can change each time the class data is instanced i need to dynamically assign the number of atom classes on creation.
See QVector, QList, QSet and probably others.
STL has also a large collection of containers, that differ in various ways.
You should read about it.
However, in your case, QList or QVector would probably be good enough.
Qt Code:
QVector<atom *> m_vecAtoms;To copy to clipboard, switch view to plain text mode





Reply With Quote

Bookmarks