Using sizeof Correctly with Byte[]

后端 未结 3 1258
感情败类
感情败类 2021-01-15 17:06

I\'m sort of out of my depths here, but I have the following code (the real code actually has a point of course):

- (NSData*) dataTheseBytes:(Byte[]) bytes {         


        
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-15 17:16

    You cannot pass arrays to a function. You're passing a pointer to the first element in the array of the caller.

    If you need the length of that array, you need to pass that length as a separate argument to your function, and use that instead of sizeof

提交回复
热议问题