No, this would not be the same. You are assuming that typeof(ptr+offset) is the same as typeof(ptr). They may not be.