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

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -