---
title: "CFBitVectorSetBitAtIndex(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfbitvectorsetbitatindex(_:_:_:)"
---

# CFBitVectorSetBitAtIndex(_:_:_:)

Sets the value of a particular bit in a bit vector.

## Declaration

```swift
func CFBitVectorSetBitAtIndex(_ bv: CFMutableBitVector!, _ idx: CFIndex, _ value: CFBit)
```

## Parameters

- `bv`: The bit vector to modify.
- `idx`: The index of the bit value to set. The index must be in the range 0…N-1, where N is the count of the vector.
- `value`: The bit value to which to set the bit at index idx.

## See Also

### Related Documentation

- [CFBitVectorGetCount(_:)](corefoundation/cfbitvectorgetcount(_:).md)

### Modifying a Bit Vector

- [CFBitVectorFlipBitAtIndex(_:_:)](corefoundation/cfbitvectorflipbitatindex(_:_:).md)
- [CFBitVectorFlipBits(_:_:)](corefoundation/cfbitvectorflipbits(_:_:).md)
- [CFBitVectorSetAllBits(_:_:)](corefoundation/cfbitvectorsetallbits(_:_:).md)
- [CFBitVectorSetBits(_:_:_:)](corefoundation/cfbitvectorsetbits(_:_:_:).md)
- [CFBitVectorSetCount(_:_:)](corefoundation/cfbitvectorsetcount(_:_:).md)
