---
title: merge
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osarray/merge
---

# merge

Appends all members of an array to this array.

## Declaration

```occ
bool merge(const OSArray *otherArray);
```

## Parameters

- `otherArray`: All members of thie array will be appended to the array.

## Return Value

Return Value True on success, which retains all the added objects, or false on failure which does not retain the objects.

## Discussion

Discussion Appends all members of an array to this array. The array capacity will be grown if necessary.

## See Also

### Creating an Array

- [withArray](driverkit/osarray/witharray.md)
- [withCapacity](driverkit/osarray/withcapacity.md)
- [withObjects](driverkit/osarray/withobjects.md)
- [OSArrayCreate](driverkit/osarraycreate.md)
- [free](driverkit/osarray/free.md)
- [flushCollection](driverkit/osarray/flushcollection.md)
