You cannot reliably.
Sometimes there is a null pointer denoting the end - this is one of the conventions used earlier. Most often you need to tell the length.
But there is no reliable way to determine the length. You must somehow know (or say) the length.
source
share