Hi there,
I am using a struct and a Class whose elements may be arrays. I would like though, for these arrays to be dynamically allocatable when I declare them in the Class and main code; how is it supposed to be done in C++?
I was firstly trying to do it in C, but I prefer to try in C++ because I have files to read and find it easier for them to be read in C++.
I wrap my code here; it's very simple, however, please let me know if there are more information that you need
Thank you in advance,
Best
S.M
Code:
typedef struct VertexTag{
float x; //x-coord of Vertex
float y; //y-coord of Vertex
float z; //z-coord of Vertex
} typeVertex;
//*******************************************************************//
// Domain class:
//*******************************************************************//
class Mesh{
public:
typeVertex coords[ SIZE_TO_BE_ALLOCATED_DYNAMICALLY ];
Mesh(void); // constructor
};