Compiling the following the class in the main program returns error C2784.
What could be causing the problem?
#include <iostream> // Include input/output stream
#include <cmath>
class threevector
{
public:
double xcoord, ycoord, zcoord;
// Default constructor
threevector()
{
xcoord = 0.0;
ycoord = 0.0;
zcoord = 0.0;
}
// Cartesian constructor
threevector(double x, double y, double z)
{
xcoord = x;
ycoord = y;
zcoord = z;
}
// Method to print out contents to screen
void print()
{
std::cout << xcoord << '\t'
<< ycoord << '\t'
<< zcoord << std::endl;
}
//Method to print out contents to file
void print(std::ofstream fout)
{
fout << xcoord << '\t'
<< ycoord << '\t'
<< zcoord << std::endl;
}
};