+ 1
Please reconsider, especially if running on 64bit machines where pointer size is 64bit also. Even if you can do subtraction, result of conversion may not be what you expected due to difference of type size and signedness.
That said, can you share your code link for better view of the intention?
https://www.sololearn.com/post/75089/?ref=app