Hi!
This is from my code:
struct R3
{
float x;
float y;
float z;
R3(float, float, float);
R3();
};
R3::R3(float a, float b, float c)
{
x = a;
y = b;
z = c;
}
R3::R3()
{
x = 0;
y = 0;
z = 0;
}
struct Bodies
{
int Mass;
float Dist[100];
R3 Place(float, float, float);
R3 Speed(float, float, float);
R3 Acc(float, float, float);
Bodies(int, R3, R3, R3);
};
Bodies::Bodies(int M, R3 XYZ, R3 V, R3 A)
{
Mass = M;
Place = XYZ;
Speed.x = V.x;
Speed.y = V.y;
Speed.z = V.z;
Acc.x = A.x;
Acc.y = A.y;
Acc.z = A.z;
}
My problem is, that for Place = XYZ;, it's showing the error "invalid use of member (did you forget the '&'?)" and for Speed.x = V.x; "insufficient contextual information to determine type".
I'm quite new to OOP, and I don't see where the problem might be.
Could you please tell me why doesn't it work?
Thanks.