---
title: "init(bitPattern:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/int/init(bitpattern:)-2i0qy"
---

# init(bitPattern:)

Creates a new value with the bit pattern of the given pointer.

## Declaration

```swift
init<P>(bitPattern pointer: P?) where P : _Pointer
```

## Parameters

- `pointer`: The pointer to use as the source for the new integer.

## Discussion

Discussion The new value represents the address of the pointer passed as pointer. If pointer is nil, the result is 0.

## See Also

### Working with Memory Addresses

- [init(bitPattern:)](swift/int/init(bitpattern:)-2o9co.md)
- [init(bitPattern:)](swift/int/init(bitpattern:)-5qm7a.md)
