Topic: Libraries in User Defined Classes: How?
Author: scottw@geomag.gly.fsu.edu (Scott Whitecross)
Date: 25 Oct 1994 16:26:35 GMT Raw View
I've defined the class below, and then wanted to use the sqrt function
(I've included the math.h library). For some reason, in the class, the
sqrt will not work. Any help will is greatly appreciated.
class head {
node number[horinodes][vertnodes];
int iterations;
float difference;
public:
head();
void startvalues();
void displayfield();
void centraldif();
void iterate();
};
Here's the function that the sqrt() function won't work in:
void head::startvalues()
{
for (int i = 1; i < horinodes - 1; i++)
{
number[i][0].value = (sqrt(leftboundary) +
sqrt(rightboundary) * i);
}
}
Thanks.