It is important to remember that pointer addition is not a legal operation; however, pointer subtraction is, and this can be used to calculate the number of array elements. An example of arthritis this can be seen in the following code snippet, which is incorrect due to the pointer addition: mid=(low+high)/2. To correctly calculate the number of array elements, one should use the following: mid=low+(high-low)/2.
2023年1月31日 20:12
It is important to remember that pointer addition is not a legal operation; however, pointer subtraction is, and this can be used to calculate the number of array elements. An example of arthritis this can be seen in the following code snippet, which is incorrect due to the pointer addition: mid=(low+high)/2. To correctly calculate the number of array elements, one should use the following: mid=low+(high-low)/2.