I am kind of struggling with this Access violation writing location.
I have two classes:
The first one-
class_A
{
private:
struct Complex
{
float time;
vector<vector<float>> matrix;
};
Complex m_tempStruct;
ConnectivityMatrix* p_ConnMatrix; //pointer to the second class
void functionOfClass_A()
{
...
p_ConnMatrix->functionOfClass_ConnectivityMatrix(m_tempStruct.time, &m_tempStruct.matrix); //sending float and a pointer to vector<vector<float>>
...
}
};
The second one-
class ConnectivityMatrix
{
private:
struct Complex
{
float time;
vector<vector<float>> matrix;
};
Complex m_tempStruct;
vector<Complex> m_mainVectorConnectivity;
public:
void functionOfClass_ConnectivityMatrix(float time, vector<vector<float>>* matrix)
{
...
m_tempStruct.time = time; // <--- crashes here
m_tempStruct.matrix = *matrix;
m_mainVectorConnectivity.push_back(m_tempStruct);
...
}
};
I can see that time
holds a float value and matrix
holds two dimension vector of float. but I can't understand why I get this Access violation when I try to assign it on m_tempStruct.time
I will be happy for help on this one.
Thanks.