Question: I have the following pointer:

```
jfloat *verticesLocal;

```

And I want make a new copy to:

```
jfloat *vertices;

```

I want to copy the values from `verticesLocal` to `vertices`.

How can I do that? I've just tried the following command, but it doesn't work:

```
memcpy(vertices, verticesLocal, numVerticesLocal * sizeof(jfloat));

```

I can't see the error because I'm working with Android native code. Sorry.

Answer: 
`malloc` first, then do your `memcpy`.
If you are copying the pointer, it is a simple assignment:

```
jfloat* verticesLocal; // assuming is is allocated already
jfloat* newVertices = verticesLocal;

```

IF you mean you want to copy the data the point points to, you have to allocate the memory for the new block of memory first:

// assume jfloat\* verticesLocal is pointing to a valid memory block of size i

```
jfloat* newVertices = new jfloat[i];
memcpy(newVertices, verticesLocal, i * sizeof(jfloat));

```