Array != pointer.
error: invalid array assignment
node->point = p;
Here is the correct way to copy the array:
std::copy(std::begin(p),std::end(p), std::begin(node->point));
If you know the size of the array at compile time, you should use std::array:
class Node {
public:
std::array<float,3> point;
};
std::array<float,3> p = {34.0f, 90.0f, 10.0f};
node->point = p;
Also, you may initialize the array via constructor and leave point as private data member:
// Ctor
Node(std::array<float,3> p) { point = p; }
// Calling
Node *node = new Node({34.0f, 90.0f, 10.0f});
// Or
std::array<float,3> p = {34.0f, 90.0f, 10.0f};
Node *node = new Node(p);
Otherwise, if you want to choose the size of the array at runtime, you should use std::vector.
std::array<float, 3>insteadusing point_t = std::array<float, 3>;