Two pointers comparison -


pf1==pf2    pf1 , pf2 point same array element  pf1>pf2     pf1 higher address location  pf1<pf2     pf2 lower  address location 

i want know if third sentence should be:pf2 higher address location

the third statement should either:

  • pf2 higher address location
  • pf1 lower address location

these statements equivalent in context. original quote got caught not making mind of 2 correct statements wanted make , ended being erroneous combining them.

under memory addressing schemes such segmented addressing on 8086, possible have 2 different values segment:offset refer same address (because segments overlap). depending on whether (or how) pointer values normalized before comparison, might have pf1 < pf2 pointers still refer same address. however, sufficiently esoteric you're unlikely ever run such problem in practice.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -