NSString * str_1 = [[NSString alloc]initWithUTF8String:"hello world"];
NSString * str2 = [NSString stringWithUTF8String:"hello world"];
//把C的字符串转化为OC的字符串
const char *p = [str UTF8String];
//将OC字符串转化为C的字符串
NSString * str_1 = [[NSString alloc]initWithUTF8String:"hello world"];
NSString * str2 = [NSString stringWithUTF8String:"hello world"];
//把C的字符串转化为OC的字符串
const char *p = [str UTF8String];
//将OC字符串转化为C的字符串
本文标题:C-OC字符串转化
本文链接:https://www.haomeiwen.com/subject/jhpmjttx.html
网友评论