---
title: "initialize(repeating:count:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/unsafemutablepointer/initialize(repeating:count:)"
---

# initialize(repeating:count:)

Initializes this pointer’s memory with the specified number of consecutive copies of the given value.

## Declaration

```swift
func initialize(repeating repeatedValue: Pointee, count: Int)
```

## Parameters

- `repeatedValue`: The instance to initialize this pointer’s memory with.
- `count`: The number of consecutive copies of newValue to initialize. count must not be negative.

## Discussion

Discussion The destination memory must be uninitialized or the pointer’s Pointee must be a trivial type. After a call to initialize(repeating:count:), the memory referenced by this pointer is initialized.
