Click here to Skip to main content
15,899,025 members

Comments by alalba (Top 2 by date)

alalba 3-Feb-17 10:44am View    
thank you for your advise, I will try to learn how to use debugger.
alalba 2-Feb-17 22:15pm View    
At first, I also thought this like u , until I encounter this problem. First, if I don't adjust the pointer by sizeof(int), the length of the array I got for the expression (tail-start) is 4 times than it actually is. Second if I use the value in my code "int offsetMid= (tail-start)/2/sizeof(int);//by unit of int" without adjusted by sizeof(int), the value of *(start + offsetMid) will get me a value that not exist in the array,cause offsetMid is 4 times larger than it should be