how do I just compare first address?

1
2
3
list<short int>::reverse_iterator
		it1 = myList.rbegin(),
		it2 = addend2.myList.rbegin();

so if i have this number enter
1
2
3
4
333 123 456-1
[0] [1] [2] // address
345 223 445-1
[0] [1] [2]

short int first, second;
1
2
first = *it1;
second = *it2; 

so I want do something like
if(first[0] > second[0])
Last edited on
When you say

[0] = 333
[1] = 123
[2] = 456-1

are these stored in the list as separate elements? I guess so, as the max value a short int can store it 32767 (though I don't get the -1)

If the numbers are all in triplets, have you thought of storing the address using a struct?

Andy

PS Also, why the reverse iterator?
Last edited on
Topic archived. No new replies allowed.