字符串翻转


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    char chars[] = "hello, world";

    charReverse(chars);
    
    NSLog(@"%s", chars);
}

void charReverse(char* chars){
    
    char* begin = chars;
    char* end = chars + strlen(chars) - 1;
    
    while (begin

你可能感兴趣的:(字符串翻转)