I have a function that looks like the following:
func receivedData(pChData: UInt8, andLength len: CInt) {
var receivedData: Byte = Byte()
var receivedDataLength: CInt = 0
memcpy(&receivedData, &pChData, Int(len)); // Getting the error here
receivedDataLength = len
AudioHandler.sharedInstance.receiverAudio(&receivedData, WithLen: receivedDataLength)
}
Getting the error:
Cannot pass immutable value as inout argument: 'pChData' is a 'let' constant
Though none of the arguments which I am passing here are let
constants. Why am I getting this?