我需要将 NSData 转换为unsigned char b[16]
. 这就是我到目前为止所拥有的。
NSData *c = [@"testingsomething" dataUsingEncoding:NSUTF8StringEncoding];
unsigned char *a = (unsigned char *)[c bytes];
NSLog(@"size of a is %ld", sizeof(a));
unsigned char b[16] = "testingsomething";
NSLog(@"size of b is %ld", sizeof(b));
我得到的输出是;
size of a is 4
size of b is 16
我怎样才能做到这一点?帮助将不胜感激。