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: 
Q: How is foo() going to know whether pa[] is an array of 100?

In general, you have to TELL it. For example:

```
void
foo (double *pa, int len)
{
  if (len == 100)
    ...
  else
    ...

```

If you were coding in C++, however, you could use an STL container such as a vector:

```
void foo (vector<double> & pa)
{
  if (pa.size() == 100)
    ...

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