sajohn said:
A separte application is sending me a pointer to some binary data and I
need to find the size of the binary data being passed to me. Does
anyone know I can go about doing this?
You'll have to be more specific; showing us some actual code would be
a good start.
In general, a separate application (a separately running program)
can't send a meaningful pointer to another application (though there
may be some extremely system-specific tricks you can play with shared
memory). Is the pointer coming from a separate application, or from,
say, a library that your application is using?
C pointers are typed, meaning that when you declare a pointer, you
have to specify what type it points to. That gives you the size of
the pointed-to data (sizeof *ptr), but that's a fixed size, and I
suspect it's not what you want.
More commonly, a pointer points to (the first element of) an array of
some type. There's no general way to get the size of the array given
the value of the pointer. You have to get the information in some
other way. For example, a function can take two arguments, a pointer
and an integer (size_t?) indicating the length of the array. Or you
can have a sentinel value that marks the end of the array (C strings
use '\0' for this).
We can't give you any more specific advice without more specific
information.