Declaring a 2D coordinate in Perl / C / C++ -
i trying declare variable in perl holds 2 values want declare variable acts 2d coordinate point.
then need declare 'n' of these. need create n random points in graph. have study percolation theory , have algorithm in mind this. got stuck @ point.
is possible in perl? if yes, please provide syntax same.
thanks
for c/c++, can create structure hold x
, y
value.
typedef struct { double x; double y; } coordinate;
inside main function, can initialize that:
coordinate treasure = {1.5, 3.2};
to modify variable's value:
treasure.x = 3.0; treasure.y = 4.0;
Comments
Post a Comment