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: 
That's not possible. `pa` isn't *populated*, because it is not an array. It is a pointer which, by convention, points to the first element of an array. But its type is simply `pointer to double`, and it has no information about whether it points to a single double, or an array of 1, 10, 100 or 1000 elements.

The "traditional" solution would be to pass two parameters, the pointer and the size of the array:

```
void foo(double* pa, size_t arraysize)
{
    if (arraysize == 100) {
        ...
    }
    else {
        ...
    }
}

```
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.)