I have a function in C++ that I am attempting to replicate in delphi:
typedef double ANNcoord; // coordinate data type
typedef ANNcoord* ANNpoint; // a point
typedef ANNpoint* ANNpointArray; // an array of points
bool readPt(istream &in, ANNpoint p) // read point (false on EOF)
{
for (int i = 0; i < dim; i++) {
if(!(in >> p[i])) return false;
}
return true;
}
In Delphi I believe that I have correctly declared the data types.. (I could be wrong):
type
IPtr = ^IStream; // pointer to Istream
ANNcoord = Double;
ANNpoint = ^ANNcoord;
function readPt(inpt: IPtr; p: ANNpoint): boolean;
var
i: integer;
begin
for i := 0 to dim do
begin
end;
end;
But I cannot figure out how to mimic the behavior in the C++ function (probably because I do not understand the bitshift operator).
Also, I need to eventually figure out how to transfer the set of points from a Zeos TZQuery
object to the same datatype - so if anyone has some any input on that I would really appreciate it.