I have a review test question and was wondering why the answers are the way they are. Could someone please explain what you can and cannot do with the following?
Which of the following expressions are allowed, given that i and j are pointers to the same type and n is an integer?
n = i / j
n = j - i correct?
n = i % j
n = i + j
n += j
j += n correct?
i = j + n correct?
*j correct?
The correct? is what the machine gave me credit for. Why can you do n=j-i and not n=i+j?
Which of the following expressions are allowed, given that i and j are pointers to the same type and n is an integer?
n = i / j
n = j - i correct?
n = i % j
n = i + j
n += j
j += n correct?
i = j + n correct?
*j correct?
The correct? is what the machine gave me credit for. Why can you do n=j-i and not n=i+j?
Comment