I tried the following code in order to see how to get size of the data of a pointer:
#include #include #include
A pointer only points to where the data begins. It doesn't know anything about the size of the data.