how to use iterator in c++?
- by tsubasa
I'm trying to calculate distance between 2 points.
The 2 points I stored in a vector in c++: (0,0) and (1,1).
I'm supposed to get results as
0
1.4
1.4
0
but the actual result that I got is
0
1
-1
0
I think there's something wrong with the way I use iterator in vector.
Could somebody help? I posted the code below.
typedef struct point {
…