NSString * a = @ "aaa";
NSString * b = @ "bbb";
NSString * c;
C how to make the results as "aaabbb"?
Reply:
c = [a stringByAppendingString: b];
Reply:
or c = [NSString stringWithFormat: @ "% @% @", a, b];
Reply:
Upstairs 2 are correct. . .
However, add that. . . . c = [a stringByAppendingString: b]; need to b judgment, b can not be a wild pointer, or will address cross-border
or c = [NSString stringWithFormat: @ "% @% @", a, b]; may output two (nul) (nul)
Reply:
c = [NSString stringWithFormat: @ "% @% @", a, b];
Reply:
Closed posted
Reply:
No comments:
Post a Comment