I am learning C programming language, I have just started learning arrays with pointers. I have problem in this question, I hope the that output must be
Since you are coverting int* to char*, ptr[0] = 1, ptr[4] = 2, ptr[8] = 3, ptr[12] = 4 , ptr[16] = 5 and all others equal to 0. ptr+4 points to 4th element in the ptr array. So result is 2.