2020-09-03 03:54 AM
As per image sub=7(not typecasted), sub1=28(typecasted). I don't understand why is sub giving wrong value I understand I have not typecasted but,each pointer variable is holding 4 byte value (i.e int type) then,typecasting must not be required isnt it? where am I going wrong?
2020-09-03 05:05 AM
The difference of int pointers (pointers to ints which are 32 bit wide for a 32 bit processor) is counted in ints.
As defined by the C standard regarding pointer arithmetic.