I'm trying to make a vector3D class for a physics simulation and there is a strange error for some of the operator functions:
1 2 3 4 5
vector3D.cpp: In member function 'Vector3D Vector3D::operator+(const Vector3D&)':
vector3D.cpp:28:10: error: request for member 'x' in 'temp', which is of non-class type 'Vector3D()'
vector3D.cpp:29:10: error: request for member 'y' in 'temp', which is of non-class type 'Vector3D()'
vector3D.cpp:30:10: error: request for member 'z' in 'temp', which is of non-class type 'Vector3D()'
vector3D.cpp:32:12: error: conversion from 'Vector3D (*)()' to non-scalar type 'Vector3D' requested
Vector3D Vector3D::operator + (const Vector3D ¶m)
{
// Vector3D temp (); // compiler may think this is function declartion
Vector3D temp; // no braces when no parameters
temp.x = x + param.x;
temp.y = y + param.y;
temp.z = z + param.z;
return temp;
}