字符串转换问题
已经定义好一个并且初始化过的数组 char a[10]
并且NSMutableString *str=[[NSMutableString alloc]initWithString:@"jack"];
我现在想数组a赋值给str应该怎么做?
[解决办法]
char cc [10]={'0','1','2','3','4','5','6','7','8','9'};
NSString * temp=[NSString stringWithCString:cc];
NSMutableString * str=[[NSMutableString alloc]initWithString:@"jack"];
[str appendString:temp];
NSLog(@"str:%@",str);
[str release];
给你写个例子