Need help with C++ programming of coordinate system

Status
Not open for further replies.

manifolds

Newbie level 5
Joined
Jul 7, 2005
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,358
C++ xperts, help me!!

whom it may concern

i hv a set of points in x-y coordinates
(2,3), (4,5), (9,0), (8,7)......lots of them actually.

and i want to assign p[1]=(2,3)
p[2]=(4,5)
and so on..means i will hv
for(i=0,i<=N,i++)
p=(x.y)
well, something like that..

how to do that? how to make it understand that, that is a coordinate system.

is it something to do with command CPoint? or Struct or something? huhuhu..:?:
 

Re: C++ xperts, help me!!



There are a lot of method to solve your problem

One very simple soulution here

typedef struct {
int/double x, y ;
} Point ;

Point p = new[1000] ;

for( int i=o; i<N; i+ ) {
p.x = x ;
p.y = y ;
}
 

Re: C++ xperts, help me!!



so before that i should hv:

int x={2,4,5...};
int y={3,5,6,7..};

is it?
 

Re: C++ xperts, help me!!

cfant said:
No, your sintax is incorrect.

care to correct me?

another thing is: how to convert from screen coordinate to cartesian coordinate in MFC window?

haiyyyyaaa:?::?:
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…