Question: Suppose I have function 

> 
> foo(double \* pa)
> 
> 
> 

where `pa` is either populated from [0] to [100] 
OR 
`pa` is populated for [0] only.

My function does the following:

> 
> foo(double \* pa)
> 
> 
> {
> 
> 
> IF (pa is an array of 100) THEN x[0 to 100] = pa[0 to 100]
> 
> 
> ELSE x[0 to 100] = pa[0]
> 
> 
> }
> 
> 
>

Answer: 
Given the information in the `foo()` function parameters, it is not possible to find out:

* the number of elements that are "filled in"
* the total number of elements in the array pointed to by `pa`

In order to accomplish this, you will need to pass additional parameters to the `foo()` function that state how big the total array is, and how many elements have been filled in.
You can't. The only thing `foo()` knows `pa` is that it's a pointer, whether it's a null pointer or not, and if it's non-null, what it points to. It can't tell whether it points to a single object or to the first element of an array.

If possible, you should probably `foo()` so the caller has to pass in additional information:

```
void foo(double *pa, size_t count) {
    /* ... */
}

```

(Note: you should declare `foo`'s return type.)