+ 3
Please explain the output of the attached code.
5 Answers
+ 5
ptr1 = (ptr += sizeof(int))[-2];
in this line you first step forward 4 times in the array and then come back 2 times
it seems to be:
ptr1 = ptr[2];
or
ptr1 = &(ptr + 2);
so ptr1 is equal to third member of the array i.e "cat"
+ 4
I think you should revise the course!
There are many mistakes
https://www.sololearn.com/Course/C/?ref=app
+ 2
Mahdi Salmani thank you so much.....u helped me.....instead of lecturing me for uploading wrong code (which I did accidentally)......lol thank you so much.
+ 2
you'r welcome :)
+ 1
Namit Jain I corrected the code, sorry I didn't checked my code before uploading....can u explain me now!?