Reverse String

question

Write a function that takes a string as input and returns the string reversed.

Example:
Given s = "hello", return "olleh".

solution

char* reverseString(char* s){
    int size;
    for(size=0;s[size]!='\0';size++);
    int low=0,high=size-1;
    char tmp;
    while(low

你可能感兴趣的:(Reverse String)