3 votes 3 votes Let x be an array . which of the following operations are illegal and why a) ++x b) x+1 c) x++ d) x - - Sanjay Sharma asked Feb 17, 2017 Sanjay Sharma 6.5k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 4 votes 4 votes Array is a const pointer. i.e., int x[] is same as const * int x Now, ++x, incrementing a constant not allowed. Same for x++ and x--. x + 1 = is valid and goes to the address given by (x + 1*sizeof(*x)) in integer terms. Arjun answered Feb 17, 2017 • selected Feb 17, 2017 by Sanjay Sharma Arjun comment Share Follow See all 0 reply Please log in or register to add a comment.