I'm getting an error saying 'not_equal_to undeclared. First use this function.'
but not_equal_to is not a variable its a function. and it is defined directly above it, outside any other function. Why am I getting this error? I'm trying to read the output of my not_equal_to function using this statement:
1 2
if ( not_equal_to(__a,i) == 0 )
continue;
and directly above this function i have it defined:
1 2 3 4 5 6 7 8 9 10 11
int not_equal_to(int _h, int value)
{
int result;
result=1;
for (int u=0;u<_h;u++)
{
if (value=point[u])
result=0;
}
return result;
}
int not_equal_to(int _h, int value)
{
int result;
result=1;
for (int u=0;u<_h;u++)
{
if (value=point[u])
result=0;
}
return result;
}
int closest_point (int __a)
{
int find_closest_to=__a;
int closest=-1;
for (int i=0;i<amm;i++){
if ( not_equal_to(__a,i) == 0 )
continue;
if (closest<0 || find_distance(closest,point[find_closest_to])>find_distance(i,point[find_closest_to]))
closest=i;
}
if (closest<0)
{
cout << "Error occured in locating points.";
}
return closest;
}
that was only a fragment of the code, point was defined higher up.
but it still returned the error
but i fixed it by changing the name of the function to not_e_to.
is not_equal_to a pre-defined constant or something?
thanks that worked, but now i have a bigger problem that can't be resolved without seeing the whole code and knowing what the purpose of the code is.
the whole thing is 158 lines so far, would i be able to post it all here or is that too much code for someone here to spend time looking at?
No-one will be able to help if they can't see the problem.
As long as it doesn't overstep the character boundaries and its nicely formatted its not too much for anyone to go through and read.
No-one will be able to help if they can't see the problem.
As long as it doesn't overstep the character boundaries and its nicely formatted its not too much for anyone to go through and read, be sure to post what errors pop up and which lines they point to